Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

about 7 years ago

Language

Compiler

Options

Author

anonymous

about 7 years ago

$
prog.cc: In function 'int main()':
prog.cc:17:8: error: class template argument deduction failed:
  Test{i};
        ^
prog.cc:17:8: error: no matching function for call to 'Test(int&)'
prog.cc:10:2: note: candidate: 'Test(Ts&& ...)-> Test<Ts> [with Ts = {int}]' <near match>
  Test(Ts&&... Args) {
  ^~~~
prog.cc:10:2: note:   conversion of argument 1 would be ill-formed:
prog.cc:17:8: error: cannot bind rvalue reference of type 'int&&' to lvalue of type 'int'
  Test{i};
        ^
prog.cc:9:8: note: candidate: 'template<class ... Ts> Test(Test<Ts>)-> Test<Ts>'
 struct Test {
        ^~~~
prog.cc:9:8: note:   template argument deduction/substitution failed:
prog.cc:17:8: note:   mismatched types 'Test<Ts>' and 'int'
  Test{i};
        ^
Exit Code:
1