Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C++

Compiler

gcc 9.3.0

Options
Warnings
Boost 1.73.0
C++2a(GNU)
no pedantic

Author

anonymous

almost 4 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-9.3.0/include -std=gnu++2a
prog.cc: In function 'int main()':
prog.cc:10:24: error: no matching function for call to 'compare(const char [3], const char [4])'
   10 |     compare("hi", "mom");
      |                        ^
prog.cc:4:5: note: candidate: 'template<unsigned int N, unsigned int M> int compare(char (&)[N], char (&)[M])'
    4 | int compare(char (&p1)[N], char (&p2)[M])
      |     ^~~~~~~
prog.cc:4:5: note:   template argument deduction/substitution failed:
prog.cc:10:24: note:   types 'char' and 'const char' have incompatible cv-qualifiers
   10 |     compare("hi", "mom");
      |                        ^
Exit Code:
1