Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 7 years ago

Language

Compiler

Options

Author

anonymous

over 7 years ago

$
prog.cc: In function 'int main()':
prog.cc:27:21: error: no match for 'operator*' (operand types are 'bar<int>' and 'int')
     std::cout << (y * 3).n << std::endl;
                   ~~^~~
prog.cc:14:5: note: candidate: 'foo operator*(foo, foo)'
 foo operator * (foo u, foo v) {
     ^~~~~~~~
prog.cc:14:5: note:   no known conversion for argument 1 from 'bar<int>' to 'foo'
prog.cc:19:8: note: candidate: 'template<class T> bar<T> operator*(bar<T>, bar<T>)'
 bar<T> operator * (bar<T> u, bar<T> v) {
        ^~~~~~~~
prog.cc:19:8: note:   template argument deduction/substitution failed:
prog.cc:27:23: note:   mismatched types 'bar<T>' and 'int'
     std::cout << (y * 3).n << std::endl;
                       ^
Exit Code:
1