Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 7 years ago

Language

C++

Compiler

clang HEAD 8.0.0 (https://github.com/llvm-mirror/clang.git b4d73f48e2bec73dcfc2dbede2acc39ce6aee93b) (https://github.com/llvm-mirror/llvm.git 80d4302554550430bb1a9ea4331fe49a97df4f57)

Options
Warnings
Optimization
Boost 1.68.0
C++17
no pedantic

Author

anonymous

over 7 years ago

$ clang++ prog.cc -Wall -Wextra -O2 -march=native -I/opt/wandbox/boost-1.68.0/clang-head/include -std=c++17
prog.cc:19:27: error: constexpr variable 'cnt' must be initialized by a constant expression
    constexpr int cnt = [&arr, &is_even]()constexpr{
                        ~~^~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:33:22: note: in instantiation of function template specialization 'get_evens<5>' requested here
    for (const int i:get_evens(arr)){
                     ^
prog.cc:25:21: error: non-type template argument is not a constant expression
    std::array<int, cnt> result{};
                    ^~~
prog.cc:25:21: note: initializer of 'cnt' is not a constant expression
prog.cc:19:19: note: declared here
    constexpr int cnt = [&arr, &is_even]()constexpr{
                  ^
2 errors generated.
Exit Code:
1