By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,134 Members | 1,942 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,134 IT Pros & Developers. It's quick & easy.

MS Visual Studio 6.0 compile failure

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a

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

P: n/a
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

P: n/a

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.