big gap between visual studio 6 and 2003

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......
 
P

peter koch

pascalroca wrote:
[snip]
virtual std::vector< std::auto_ptr< myClass> > getValeur() = 0; [snip]
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'

[snip]

You can't have std::auto_ptr in a std::vector. This has always been the
case and you're lucky if it did work for you before. You must use for
some other solution. I would recommend you looked at boost which has
several constructs that can help you.

/Peter
 
?

=?iso-8859-1?q?Kirit_S=E6lensminde?=

pascalroca said:
this code compile under visual studio 6
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xmemory(42): error C2558:

The move from MSVC 6 to Studio .NET is painful in the extreme, but once
you've done it you won't know how you stood the old compiler. The new
compiler is so much better.

We've managed to remove all of the old template hacks we needed and the
compiler found a lot of low-level bugs that we'd not have spotted - the
sort of things that will work 99% of the time and cause you real
headaches to find otherwise.

Expect to spend ages making the transition, but once done you won't go
back.


K
 
R

Ron Natalie

Kirit said:
The move from MSVC 6 to Studio .NET is painful in the extreme, but once
you've done it you won't know how you stood the old compiler. The new
compiler is so much better.
The standards adherance is much better. It's amazing the number
of things that we were "getting away with" even with a staff of
knowledgeable programmers.
 
?

=?iso-8859-1?q?Kirit_S=E6lensminde?=

Ron said:
The standards adherance is much better. It's amazing the number
of things that we were "getting away with" even with a staff of
knowledgeable programmers.

Indeed. Shocking but true :)


K
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,024
Latest member
ARDU_PROgrammER

Latest Threads

Top