Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Boost 1.69.0
C++2a(GNU)
no pedantic
Raw compiler options
-pthread
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.69.0/gcc-8.2.0/include -std=gnu++2a -pthread
Exit Code:
1
Author
anonymous
about 6 years ago
C++
gcc 8.2.0
Author
anonymous
about 6 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.69.0/gcc-8.2.0/include -std=gnu++2a -pthread
prog.cc: In function 'int main()':
prog.cc:11:7: error: invalid initialization of non-const reference of type 'int (&)(int)' from an rvalue of type 'int (*)(int)'
g(&dbl); // Error: (function expects F&, but the argument is F*)
^~~~
prog.cc:3:5: note: in passing argument 1 of 'int g(int (&)(int))'
int g(F& f) {
^