Boost logo

Boost :

From: Emre Turkay (emreturkay_at_[hidden])
Date: 2008-04-15 06:38:33

Hi folks,

In the example below, while (1) is compiling fine, (2) causes compiler error
in linux gcc 4.1.3.
I certainly don't want to copy the member variable of the object in copy
constructor, and I need T2.
How can I handle it?



#include <boost/noncopyable.hpp>

struct A: boost::noncopyable

template <typename T>
struct B
    B() { }
    B(const B<T>& b) { } // (1)
    template <typename T2> B(const B<T2>& b) { } // (2)

    T a;

int main()
    B<A> b1;
    B<A> b2(b1);

Boost list run by bdawes at, gregod at, cpdaniel at, john at