Question: main.cpp: In function void get _ opts ( int& , char& ) : main.cpp: 2 9 : 2 6 : error: numeric _ limits is

main.cpp: In function void get_opts(int&, char&):
main.cpp:29:26: error: numeric_limits is not a member of std
std::cin.ignore(std::numeric_limits::max(),'
');
^~~~~~~~~~~~~~
main.cpp:29:56: error: expected primary-expression before > token
std::cin.ignore(std::numeric_limits::max(),'
');
^
main.cpp:29:63: error: no matching function for call to max()
std::cin.ignore(std::numeric_limits::max(),'
');
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from main.cpp:1:
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: candidate: template constexpr const _Tp& std::max(const _Tp&, const _Tp&)
max(const _Tp& __a, const _Tp& __b)
^~~
/usr/include/c++/8/bits/stl_algobase.h:219:5: note: template argument deduction/substitution failed:
main.cpp:29:63: note: candidate expects 2 arguments, 0 provided
std::cin.ignore(std::numeric_limits::max(),'
');
^
In file included from /usr/include/c++/8/bits/char_traits.h:39,
from /usr/include/c++/8/ios:40,
from /usr/include/c++/8/ostream:38,
from /usr/include/c++/8/iostream:39,
from main.cpp:1:
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: candidate: template constexpr const _Tp& std::max(const _Tp&, const _Tp&,_Compare)
max(const _Tp& __a, const _Tp& __b,_Compare __comp)
^~~
/usr/include/c++/8/bits/stl_algobase.h:265:5: note: template argument deduction/substitution failed:
main.cpp:29:63: note: candidate expects 3 arguments, 0 provided
std::cin.ignore(std::numeric_limits::max(),'
');
^
make: ***[makefile:12: main.o] Error 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!