468,765 Members | 1,184 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

MS Visual Studio 6.0 compile failure

AB
The following code compiles here in strict mode
http://www.comeaucomputing.com/tryitout/
but it does not compile using MS Visual Studio 6.0.
Can anyone offer an explanation?

class Simple
{
public:
template<class T> explicit Simple(T t){}
Simple(const Simple &orig){}
Simple(){}
};

int main()
{
const Simple simpleOne(Simple(1));
return 0;
}

error C2558: class 'Simple' : no copy constructor available
Jul 23 '05 #1
3 1104

AB wrote:
The following code compiles here in strict mode
http://www.comeaucomputing.com/tryitout/
but it does not compile using MS Visual Studio 6.0.
Can anyone offer an explanation?

class Simple
{
public:
template<class T> explicit Simple(T t){}
Simple(const Simple &orig){}
Simple(){}
};

int main()
{
const Simple simpleOne(Simple(1));
return 0;
}

error C2558: class 'Simple' : no copy constructor available


Its pretty well known that MSVC++ 6.0 does not compile templates well.
How about if you change the order of the constructors?

-shez-

Jul 23 '05 #2
Shezan Baig wrote:
Its pretty well known that MSVC++ 6.0 does not compile templates well. How about if you change the order of the constructors?

-shez-


Thankyou, surprisingly that worked. It will compile so long as the
template is defined after the copy ctor.

Jul 23 '05 #3

Mr X wrote:
Shezan Baig wrote:
Its pretty well known that MSVC++ 6.0 does not compile templates

well.
How about if you change the order of the constructors?

-shez-


Thankyou, surprisingly that worked. It will compile so long as the
template is defined after the copy ctor.

Yes. Compiler bugs are the most annoying :(

-shez-

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.