Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 7 years ago

Language

C++

Compiler

gcc HEAD 9.0.1 20190318 (experimental)

Options
Warnings
Don't Use Boost
C++17(GNU)
-pedantic

Author

anonymous

over 7 years ago

$ g++ prog.cc -Wall -Wextra -std=gnu++17 -pedantic
prog.cc: In function 'int main()':
prog.cc:19:24: error: no matching function for call to 'my_begin(int&)'
   19 |     auto y = my_begin(b);
      |                        ^
prog.cc:6:6: note: candidate: 'template<class T> decltype (t.begin()) my_begin(T&)'
    6 | auto my_begin(T & t) -> decltype(t.begin())
      |      ^~~~~~~~
prog.cc:6:6: note:   template argument deduction/substitution failed:
prog.cc: In substitution of 'template<class T> decltype (t.begin()) my_begin(T&) [with T = int]':
prog.cc:19:24:   required from here
prog.cc:6:36: error: request for member 'begin' in 't', which is of non-class type 'int'
    6 | auto my_begin(T & t) -> decltype(t.begin())
      |                                  ~~^~~~~
Exit Code:
1