Can we have vector of vector?

This is a discussion on Can we have vector of vector? within the C++ Programming forums, part of the General Programming Boards category; Remarkably, the MinGW port of g++ 3.4.5 compiles your example without errors even with -Wall. The Comeau online compiler finds ...

  1. #16
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,144
    Remarkably, the MinGW port of g++ 3.4.5 compiles your example without errors even with -Wall. The Comeau online compiler finds it okay too.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  2. #17
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by Elysia View Post
    Indeed. They are included automatically. I find it convenient, though, not annoying.
    I don't see what's so wrong with it?
    If all you do is program on Windows then there's no problem, but if you're writing for Windows & UNIX, you could have code that compiles on Windows and doesn't on UNIX.

    It doesn't really take that long to fix, but it still annoys me.

  3. #18
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,904
    Then stuff all common includes in one header and include it in your projects. Problem fixed.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #19
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by laserlight View Post
    Remarkably, the MinGW port of g++ 3.4.5 compiles your example without errors even with -Wall. The Comeau online compiler finds it okay too.
    Actually, I only tried this particular example on VC++, but I remember seeing a problem like this where I was missing some C headers... Whether I saw it on Linux, Solaris or both, I don't remember.

  5. #20
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,144
    Actually, I only tried this particular example on VC++, but I remember seeing a problem like this where I was missing some C headers...
    Well, it goes to show that the problem is not MS specific.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  6. #21
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by laserlight View Post
    Well, it goes to show that the problem is not MS specific.
    OK, I surrender.
    There's lots of other things to complain about, so I'll let MS win (this time).

  7. #22
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,263
    Quote Originally Posted by Elysia View Post
    I don't really understand why the standard specifies you must use > > either, since it's rather absurd. It doesn't really matter if it can be mistaken for the operator or not, since it's the compiler vendor's work to make sure it works.
    Allowing '>>' in template declarations seems like a simple enough requirement, but the amount of work required in the compiler's parser would be ridiculous in comparison to the benefit of allowing it, which is practically zero.

    And the idea of a standards body is to formalize and enhance existing practice, not to subject implementers to onerous, pointless requirements. It's not, "We create the standard and now you have to do it this way," it's practically the exact opposite.

  8. #23
    Registered User
    Join Date
    Jan 2005
    Posts
    7,344
    Of course, now that compiler vendors have had time to make the necessary changes to handle >>, they will be changing the next standard to allow it.

    In this case, not allowing >> is odd and forcing compiler vendors to support it makes sense once they have enough time to do so.

  9. #24
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,597
    MSVS 6, 2003, and 2005 all have had this 'auto-include' of headers for quite some time. The problem comes when it demands you must include some headers but yet does not enforce you including others that the code clearly needs. It has something to do with your project options and which 'common' libraries/headers, if any, you wish to use. By default MSVS knows where the standard libraries are as well as the headers. Once you install Platform SDK and integrate it into VS it usually also knows where to find the Platform SDK files. There are times when you can get away with not including Platform SDK headers and it will still compile.

    However what is very odd in VS is Intellisense. Often it shows functions, variables, etc, that look to be accessible and yet often when you compile it complains of unresolved externals or undefined symbols. Intellisense often does not match exactly what is 'visible' at the current location in your code. Often times it shows functions and methods that are clearly not accessible yet it appears they are. This is extremely annoying. Other times Intellisense just completely fails to show anything, does not update correctly when you alter headers, or gets corrupted.

  10. #25
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    22,904
    Quote Originally Posted by Bubba View Post
    However what is very odd in VS is Intellisense. Often it shows functions, variables, etc, that look to be accessible and yet often when you compile it complains of unresolved externals or undefined symbols. Intellisense often does not match exactly what is 'visible' at the current location in your code. Often times it shows functions and methods that are clearly not accessible yet it appears they are. This is extremely annoying.
    That behavior was changed in MSVC8 (aka 2005). It actually needs the proper headers to be able to see the functions.

    Other times Intellisense just completely fails to show anything, does not update correctly when you alter headers, or gets corrupted.
    Yes, IntelliSense support is quite old by now, though I've heard they'll be updating it for the next version. Thank the gods for that; it's quite a mess right now.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can some one please tell me the cause of the error ?
    By broli86 in forum C Programming
    Replies: 8
    Last Post: 06-26-2008, 09:36 PM
  2. syntax help?
    By scoobygoo in forum C++ Programming
    Replies: 1
    Last Post: 08-07-2007, 11:38 AM
  3. Vector class
    By Desolation in forum C++ Programming
    Replies: 2
    Last Post: 05-12-2007, 06:44 PM
  4. Need some help/advise for Public/Private classes
    By nirali35 in forum C++ Programming
    Replies: 8
    Last Post: 09-23-2006, 01:34 PM
  5. Certain functions
    By Lurker in forum C++ Programming
    Replies: 3
    Last Post: 12-26-2003, 01:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21