Author
anonymous
over 6 years ago
Language
C++
Compiler
gcc 8.2.0
Options
Warnings
Boost 1.68.0
C++2a(GNU)
no pedantic
Author
anonymous
over 6 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.68.0/gcc-8.2.0/include -std=gnu++2a
prog.cc: In lambda function:
prog.cc:17:44: warning: typedef 'using predicate_t = decltype (predicate)' locally defined but not used [-Wunused-local-typedefs]
using predicate_t = decltype(predicate);
^
prog.cc: In instantiation of '<lambda(auto:1, auto:2&&)> [with auto:1 = main()::<lambda(auto:4)>; auto:2 = const string<'a', 'b', 'a', 'b', 'a'>&]':
prog.cc:37:89: required from here
prog.cc:20:9: error: 'predicate' is not captured
if constexpr (is_bool_constant_like_v<predicate_return_t>) {
^~
prog.cc:18:20: note: the lambda has no capture-default
constexpr auto func = [](auto x) {
^~~~
prog.cc:16:35: note: 'main()::<lambda(auto:4)> predicate' declared here
constexpr auto index_if = [](auto predicate, auto &&tup) {
~~~~~^~~~~~~~~
prog.cc:16:53: warning: unused parameter 'tup' [-Wunused-parameter]
constexpr auto index_if = [](auto predicate, auto &&tup) {
~~~~~~~^~~
prog.cc: In function 'int main()':
prog.cc:37:20: warning: unused variable 'xxx' [-Wunused-variable]
constexpr auto xxx = index_if([](auto x) constexpr { return bool_c<true>; }, abababa);
^~~
Exit Code:
1