473,511 Members | 14,825 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

compilation errors

class Party{
public:
double averageNames(int n, int personA[], int personB[]){
vector<set<int>> personsKnown;
//vector< set<int> > personsKnown;
}
};

int main(){
Party p;
return 0;
}
can anybody plz explain me why the code dosn't compile on msvc6 wheere
as the line that is commented compiles perfectly.note the only
difference between the two is of the spaces
around <>.
thanks
rt

Nov 17 '05 #1
2 808
ra************@gmail.com wrote:
class Party{
public:
double averageNames(int n, int personA[], int personB[]){
vector<set<int>> personsKnown;
//vector< set<int> > personsKnown;
}
};

int main(){
Party p;
return 0;
}
can anybody plz explain me why the code dosn't compile on msvc6
wheere as the line that is commented compiles perfectly.note the only
difference between the two is of the spaces
around <>.


Because that's the way the C++ standard says it's supposed to work. When you
have nested template-id's, you have to put whitespace between the closing >
in order to have it parse correctly, Without the space, it parses as a
right-shift operator.

The C++ committee has proposed changing the parsing rules to allow
constructs such as the above to compile without the whitespace, but that
recommendation is not part of any standard yet. Nonetheless, VC++ 8.0 (VS
2005) in fact implements the new rule and would compile your code as
originally written.

-cd
Nov 17 '05 #2
thanks a lot carl !!!

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2573
by: FireStarter | last post by:
Guys, in the code that follows, why does the method F() still compile, even if DBG is undefined? Inside method G(), the code inside <#if DBG> does not compile (notice that I can write whatever I...
2
2802
by: Tommy Vercetti | last post by:
In Visual Studio .NET 2003, I do the following 1) File->New->Project 2) Visual C++ Projects->.NET->Windows Forms Application 3) Project->Add New Item->C++ File 4) Clear the new C++ file and...
2
6915
by: Kevin R. | last post by:
I have been ignoring this problem for a few weeks now, but it's becoming a bit annoying not to mention unproductive. Here it goes: I compile my project with no errors. Then after I debug/run it,...
2
1519
by: Steve | last post by:
Hi I'm receiving the following error whenever a new build is placed onto our production server: Timed out waiting for a program to execute. The command being executed was...
0
1175
by: Mythran | last post by:
I'm have 2 primary errors that seem to occur. 1.) In my ASP.Net application, I have 3 libraries (BLL, DAL, and Schema) that are used for the 4th and 5th UI libraries. All of the dependant...
6
9777
by: alban | last post by:
Hello I have got some problems of compilation on a AIX IBM, I use the XLC compilator (And I can't install another one). I try to compile code Pro*c ".pc" (oracle), I need do a pre-compilation...
3
3375
by: seema | last post by:
Hi all, I am new to C programming. I have problem compiling a sample , #include <stdio.h> int getuniqueaddress1(){ return 1; } int getuniqueaddress2(){ return 2;
1
2567
by: J.A. | last post by:
Hi, I'm trying to use the CSharpCompilerProvider to dynamically compile some code. The test console app works fine but I get this error when using the same code in an ASP.NET app: error CS1619:...
35
2984
by: mwelsh1118 | last post by:
Why doesn't C# allow incremental compilation like Java? Specifically, in Java I can compile single .java files in isolation. The resulting individual .class files can be grouped into .jar files....
1
2793
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
0
7252
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7371
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1583
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.