P
pascalroca
class myClass
{
int lacement ;
public :
myClass(){};
myClass(const myClass& ref){}
virtual std::vector< std::auto_ptr< myClass> > getValeur() = 0;
};
typedef std::auto_ptr< myClass> myClassPtr;
class myClassImpl : public myClass
{
public :
myClassImpl(){};
myClassImpl(const myClassImpl& ref){}
virtual std::vector<myClassPtr> getValeur()
{
std::vector<myClassPtr> vec;
return vec;
};
};
this code compile under visual studio 6
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xmemory(42): error C2558:
class 'std::auto_ptr<_Ty>' : no copy constructor available or copy
constructor is declared 'explicit'
with
[
_Ty=myClass
]
// TEMPLATE FUNCTION _Construct
template<class _T1,
class _T2> inline
void _Construct(_T1 _FARQ *_Ptr, const _T2& _Val)
{ // construct object at _Ptr with value _Val
new ((void _FARQ *)_Ptr) _T1(_Val);
}
it tries to construct an abstract class......
{
int lacement ;
public :
myClass(){};
myClass(const myClass& ref){}
virtual std::vector< std::auto_ptr< myClass> > getValeur() = 0;
};
typedef std::auto_ptr< myClass> myClassPtr;
class myClassImpl : public myClass
{
public :
myClassImpl(){};
myClassImpl(const myClassImpl& ref){}
virtual std::vector<myClassPtr> getValeur()
{
std::vector<myClassPtr> vec;
return vec;
};
};
this code compile under visual studio 6
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xmemory(42): error C2558:
class 'std::auto_ptr<_Ty>' : no copy constructor available or copy
constructor is declared 'explicit'
with
[
_Ty=myClass
]
// TEMPLATE FUNCTION _Construct
template<class _T1,
class _T2> inline
void _Construct(_T1 _FARQ *_Ptr, const _T2& _Val)
{ // construct object at _Ptr with value _Val
new ((void _FARQ *)_Ptr) _T1(_Val);
}
it tries to construct an abstract class......