Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 7 years ago

Language

Compiler

Options

Author

anonymous

over 7 years ago

$
prog.cc: In function 'int main(int, char**)':
prog.cc:17:36: error: no matching function for call to 'Apply(main(int, char**)::<lambda()>)'
  int i1 = Apply([]() { return 10; });
                                    ^
prog.cc:4:3: note: candidate: 'template<class T> T Apply(const std::function<T()>&)'
 T Apply(const std::function<T()>& func)
   ^~~~~
prog.cc:4:3: note:   template argument deduction/substitution failed:
prog.cc:17:36: note:   'main(int, char**)::<lambda()>' is not derived from 'const std::function<T()>'
  int i1 = Apply([]() { return 10; });
                                    ^
prog.cc:18:39: error: no matching function for call to 'Apply(main(int, char**)::<lambda()>)'
  bool b1 = Apply([]() { return true; });
                                       ^
prog.cc:4:3: note: candidate: 'template<class T> T Apply(const std::function<T()>&)'
 T Apply(const std::function<T()>& func)
   ^~~~~
prog.cc:4:3: note:   template argument deduction/substitution failed:
prog.cc:18:39: note:   'main(int, char**)::<lambda()>' is not derived from 'const std::function<T()>'
  bool b1 = Apply([]() { return true; });
                                       ^
prog.cc:19:24: error: no matching function for call to 'Apply(main(int, char**)::<lambda()>)'
  Apply([]() { return; });
                        ^
prog.cc:4:3: note: candidate: 'template<class T> T Apply(const std::function<T()>&)'
 T Apply(const std::function<T()>& func)
   ^~~~~
prog.cc:4:3: note:   template argument deduction/substitution failed:
prog.cc:19:24: note:   'main(int, char**)::<lambda()>' is not derived from 'const std::function<T()>'
  Apply([]() { return; });
                        ^
prog.cc:17:6: warning: unused variable 'i1' [-Wunused-variable]
  int i1 = Apply([]() { return 10; });
      ^~
prog.cc:18:7: warning: unused variable 'b1' [-Wunused-variable]
  bool b1 = Apply([]() { return true; });
       ^~
prog.cc:15:14: warning: unused parameter 'argc' [-Wunused-parameter]
 int main(int argc, char *argv[])
          ~~~~^~~~
prog.cc:15:26: warning: unused parameter 'argv' [-Wunused-parameter]
 int main(int argc, char *argv[])
                    ~~~~~~^~~~~~
Exit Code:
1