Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I tried to overload Below is my code main W460239957@DESKTOP-Q068R3R:/mnt/h/3010/Hw2$ g++ -std=c++17 Counter.hpp main.cpp Counter.hpp:13:72: warning: friend declaration 'std::ostream& operator&)' declares a non-template function [-Wnon-template-friend]
I tried to overload
Below is my code
main
W460239957@DESKTOP-Q068R3R:/mnt/h/3010/Hw2$ g++ -std=c++17 Counter.hpp main.cpp Counter.hpp:13:72: warning: friend declaration 'std::ostream& operator&)' declares a non-template function [-Wnon-template-friend] 13 friend std::ostream& operator &b); Counter.hpp:13:72: note: (if this is not what you intended, make sure the function template has already been declared and add after the function name here) /usr/bin/ld: /tmp/ccVvVwry.o: in function 'main': main.cpp:(. text+ex204): undefined reference to operator, std::allocatorStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started