struct Bar{}; template<typename T>class Foo{ Foo(Foo& Rhs); Foo& operator= (Foo& Rhs); Foo(Foo const& Rhs); Foo& operator= (Foo const& Rhs); public: Foo(Bar const& Rhs) { }}; int main(){ Foo<int> MyFoo = Bar();}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:11:2: error: ‘Foo<T>::Foo(const Foo<T>&) [with T = int]’ is private Foo(Foo const& Rhs); ^ prog.cpp:22:23: error: within this context Foo<int> MyFoo = Bar(); ^
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!