Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C++

Compiler

clang HEAD 13.0.0 (https://github.com/llvm/llvm-project.git c4ed142e695f14ba5675ec6d12226ee706329a0f)

Options
Warnings
Boost 1.73.0
C++2b(GNU)
no pedantic

Author

anonymous

almost 4 years ago

$ clang++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/clang-head/include -std=gnu++2b
prog.cc:21:18: error: no matching function for call to 'NumArguments'
    std::cout << NumArguments<int>() << std::endl; // 1
                 ^~~~~~~~~~~~~~~~~
prog.cc:11:5: note: candidate template ignored: constraints not satisfied [with Args = <int>]
int NumArguments() requires VoidArgs<Args...> {
    ^
prog.cc:11:29: note: because 'int' does not satisfy 'VoidArgs'
int NumArguments() requires VoidArgs<Args...> {
                            ^
prog.cc:8:20: note: because 'sizeof...(Args) == 0' (1 == 0) evaluated to false
concept VoidArgs = sizeof...(Args) == 0;
                   ^
prog.cc:16:5: note: candidate template ignored: constraints not satisfied [with FirstArg = int, RemainingArgs = <>]
int NumArguments() requires NonVoidArgs<RemainingArgs...> {
    ^
prog.cc:16:29: note: because 'NonVoidArgs<>' evaluated to false
int NumArguments() requires NonVoidArgs<RemainingArgs...> {
                            ^
prog.cc:5:23: note: because 'sizeof...(Args) > 0' (0 > 0) evaluated to false
concept NonVoidArgs = sizeof...(Args) > 0;
                      ^
prog.cc:17:14: error: no matching function for call to 'NumArguments'
  return 1 + NumArguments<RemainingArgs...>();
             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc:17:14: note: in instantiation of function template specialization 'NumArguments<double, char>' requested here
prog.cc:17:14: note: in instantiation of function template specialization 'NumArguments<int, double, char>' requested here
prog.cc:23:18: note: in instantiation of function template specialization 'NumArguments<float, int, double, char>' requested here
    std::cout << NumArguments<float, int, double, char>() << std::endl; // 4
                 ^
prog.cc:11:5: note: candidate template ignored: constraints not satisfied [with Args = <char>]
int NumArguments() requires VoidArgs<Args...> {
    ^
prog.cc:11:29: note: because 'char' does not satisfy 'VoidArgs'
int NumArguments() requires VoidArgs<Args...> {
                            ^
prog.cc:8:20: note: because 'sizeof...(Args) == 0' (1 == 0) evaluated to false
concept VoidArgs = sizeof...(Args) == 0;
                   ^
prog.cc:16:5: note: candidate template ignored: constraints not satisfied [with FirstArg = char, RemainingArgs = <>]
int NumArguments() requires NonVoidArgs<RemainingArgs...> {
    ^
prog.cc:16:29: note: because 'NonVoidArgs<>' evaluated to false
int NumArguments() requires NonVoidArgs<RemainingArgs...> {
                            ^
prog.cc:5:23: note: because 'sizeof...(Args) > 0' (0 > 0) evaluated to false
concept NonVoidArgs = sizeof...(Args) > 0;
                      ^
2 errors generated.
Exit Code:
1