Author
anonymous
almost 7 years ago
Language
Compiler
Options
Author
anonymous
almost 7 years ago
$
prog.cc:12:2: error: constructor cannot be redeclared
A(U&& val)
^
prog.cc:6:2: note: previous definition is here
A(U&& val)
^
prog.cc:20:4: error: no matching constructor for initialization of 'A'
A a1(1);
^ ~
prog.cc:3:8: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const A' for 1st argument
struct A
^
prog.cc:3:8: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'A' for 1st argument
struct A
^
prog.cc:6:2: note: candidate template ignored: requirement 'std::is_constructible<std::string, int>::value' was not satisfied [with U = int]
A(U&& val)
^
2 errors generated.
Exit Code:
1