Created
July 12, 2019 02:20
-
-
Save tosik/1a8c415590157e1c789195c3162b267c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main.cpp:6:10: error: no viable conversion from 'A<Bar>' to 'A<Foo>' | |
A<Foo> a = A<Bar>(); | |
^ ~~~~~~~~ | |
main.cpp:3:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'A<Bar>' to 'const A<Foo> &' for 1st argument | |
template <typename T> class A {}; | |
^ | |
main.cpp:3:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'A<Bar>' to 'A<Foo> &&' for 1st argument | |
template <typename T> class A {}; | |
^ | |
1 error generated. | |
make: *** [all] Error 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo {}; | |
class Bar : public Foo {}; | |
template <typename T> class A {}; | |
int main() { | |
A<Foo> a = A<Bar>(); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment