Language
C++
Compiler
gcc 7.2.0
Options
Warnings
Boost 1.65.1
C++1z(GNU)
no pedantic
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.65.1/gcc-7.2.0/include -std=gnu++1z
Exit Code:
1
Author
anonymous
over 7 years ago
C++
gcc 7.2.0
Author
anonymous
over 7 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.65.1/gcc-7.2.0/include -std=gnu++1z
prog.cc: In instantiation of 'main()::<lambda(auto:1&)> [with auto:1 = const int]':
prog.cc:12:38: required by substitution of 'template<class F> decltype (declval<F>()(declval<const int&>())) Something<int>::foo<F>(F&&) const [with F = main()::<lambda(auto:1&)>]'
prog.cc:19:6: required from here
prog.cc:18:9: error: increment of read-only reference 'val'
++val;
^~~~~