Record Detail

Compile Error

/in/ex2.cpp: In function 'int main()':
/in/ex2.cpp:27:33: error: no match for 'operator-' (operand types are 'int' and 'std::_Setw')
         int asterisksCount = 11 - std::setw(11); // Adjust based on the actual width used
                              ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/ex2.cpp:1:
/usr/include/c++/7/bits/stl_iterator.h:1194:5: note: candidate: template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const std::move_iterator<_IteratorL>&, const std::move_iterator<_IteratorR>&)
     operator-(const move_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:1194:5: note:   template argument deduction/substitution failed:
/in/ex2.cpp:27:47: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
         int asterisksCount = 11 - std::setw(11); // Adjust based on the actual width used
                                               ^
In file included from /usr/include/c++/7/bits/stl_algobase.h:67:0,
                 from /usr/include/c++/7/bits/char_traits.h:39,
                 from /usr/include/c++/7/ios:40,
                 from /usr/include/c++/7/ostream:38,
                 from /usr/include/c++/7/iostream:39,
                 from /in/ex2.cpp:1:
/usr/include/c++/7/bits/stl_iterator.h:392:5: note: candidate: template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const std::reverse_iterator<_Iterator>&, const std::reverse_iterator<_IteratorR>&)
     operator-(const reverse_iterator<_IteratorL>& __x,
     ^~~~~~~~
/usr/include/c++/7/bits/stl_iterator.h:392:5: note:   template argument deduction/substitution failed:
/in/ex2.cpp:27:47: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
         int asterisksCount = 11 - std::setw(11); // Adjust based on the actual width used
                                               ^

Information

Submit By
Type
Submission
Homework
Lab10 Thu
Language
C++
Submit At
2024-07-25 19:37:40
Judged At
2024-07-25 19:37:40
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes