473,385 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1157

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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Tom Lee | last post by:
Hi, I'm new to .NET 2003 compiler. When I tried to compile my program using DEBUG mode, I got the following errors in the C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7 \include\xdebug...
1
by: Novice | last post by:
Hi all, I'm afraid this is the second posting of this information as I didn't get a response on the previous post. I will try to shorten my message (i.e. be more concise) in the hopes that it will...
3
by: Shapper | last post by:
Hello, I am starting 2 new projects to deliver in January 2006. I want to create them in Asp.Net 2.0 using Visual Studio 2005. All my clients web sites are Visual Studio 2003 projects in...
0
jwwicks
by: jwwicks | last post by:
Introduction This tutorial describes how to use Visual Studio to create a new C++ program, compile/run a program, resume work on an existing program and debug a program. It is aimed at the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.