Re: Can't pass temporary with hidden copy ctor as const ref
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Matt, Matt Hoosier a écrit : > Hi, > > I'm having trouble compiling the following with g++ 4.2.1: > > class Uncopyable > { > public: > Uncopyable(int x) {} > private: > Uncopyable(const Uncopyable & other) {} > }; > >
Can't pass temporary with hidden copy ctor as const ref
Hi, I'm having trouble compiling the following with g++ 4.2.1: class Uncopyable { public: Uncopyable(int x) {} private: Uncopyable(const Uncopyable & other) {} }; class User { public: void foo(int x) { foo(Uncopyable(x)); } void foo(