471,111 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,111 software developers and data experts.

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 1134

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.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.