V
Vincent RICHOMME
Hi,
I found a project called ACF and that implemnts .NET classes into C++.
The issue come from the fact that it was developped under VS 2003
and under 2005 I get the following
c:\acf\src\corlib\acf\acfbase.h(364) : error C2299:
'Acf::RefPtr<T>::RefPtr' : behavior change: an explicit specialization
cannot be a copy constructor or copy assignment operator
template <class T> // T: reference types (object, interface)
class RefPtr
{
// Fields
private:
T* _p;
// Constructor & Destructor
public:
RefPtr() : _p(null)
{
}
RefPtr(T* p) : _p(p)
{
_AddRef();
}
// Templated version to allow pBase = pDerived
template <class U>
RefPtr(const RefPtr<U>& src) : _p((U*)src)
{
_AddRef();
}
// METHOD BELOW DO NOT COMPILE
template <>
RefPtr(const RefPtr<T>& src) : _p((T*)src)
{
_AddRef();
}
~RefPtr()
{
_Release();
}
.....
};
How can I fix that ?
I found a project called ACF and that implemnts .NET classes into C++.
The issue come from the fact that it was developped under VS 2003
and under 2005 I get the following
c:\acf\src\corlib\acf\acfbase.h(364) : error C2299:
'Acf::RefPtr<T>::RefPtr' : behavior change: an explicit specialization
cannot be a copy constructor or copy assignment operator
template <class T> // T: reference types (object, interface)
class RefPtr
{
// Fields
private:
T* _p;
// Constructor & Destructor
public:
RefPtr() : _p(null)
{
}
RefPtr(T* p) : _p(p)
{
_AddRef();
}
// Templated version to allow pBase = pDerived
template <class U>
RefPtr(const RefPtr<U>& src) : _p((U*)src)
{
_AddRef();
}
// METHOD BELOW DO NOT COMPILE
template <>
RefPtr(const RefPtr<T>& src) : _p((T*)src)
{
_AddRef();
}
~RefPtr()
{
_Release();
}
.....
};
How can I fix that ?