------- Additional Comments From bangerth at dealii dot org 2004-12-21 17:36 ------- gcc is correct: the result of getSomething is a temporary. Temporaries can only be bound to const references, not to non-const ones. Thus, the constructor UsePointer(Pointer<TEST> &point) : m_localCopy(point) {} is not a candidate. In order to use the constructor UsePointer(Pointer<TEST> point) : m_localCopy(point) { } you need to be able to copy objects of type Pointer<int>, but then you run into the same problem of not having an appropriate copy constructor of Pointer that takes a constant reference. W.
-- What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19112