Thread: visual studio 2006 problem

  1. #31
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    So does that mean that hk_mp5kpdw's posted code has a fix? If so, then the OP can download SP6 and all will be well.

    BTW, you wouldn't happen to have a link to a KB on that issue or something, would you?

  2. #32
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    I think hk_mp5kpdw's posted code is right out of the VC6.0 vector header (looks like my SP6 header).

    The problem is that there's no conversion between vector::reverse_iterator to vector::const_iterater. So the compiler tries to use the "vector(size_type, const Type&)" constructor. Which is why the op gets the compiler error "cannot convert parameter 1 from reverse_iterator<> to unsigned int".

    Don't have any KB links.

    gg

  3. #33
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> typedef const_iterator _It

    I missed that line and was assuming _It was a templated type. I see where that code fails now.

  4. #34
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Codeplug has the answer. VC++6 didn't support member templates (function templates as members of class templates), which is why the standard library cannot be conforming. The standard requires a templated constructor taking an arbitrary pair of iterators. Because of the lacking functionality, the STL that ships with VC++6 only provides one that takes a pair of vector's own forward iterators.

    Installing a service pack won't help.
    Installing the platform SDK won't help.
    Installing an alternative STL implementation won't help.

    The only thing that will help is getting rid of that aged fossil that is VC++6.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  5. #35
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    >> Installing an alternative STL implementation won't help.
    You'll never have a fully conforming implementation with a fossil compiler, but STLport does its best. It had no problems constructing a vector from reverse iterators anyways

    gg

  6. #36
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Yeah, it might have an overload for that.

    Now try list's iterators, iostream iterators, and some of Boost's special iterator adapters (Listed in decreasing likelihood that they bothered to add an overload.) Be sure to make the foreign iterator have a different value type, e.g. try to initialize a vector<int> from a list<short>.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  2. Console Font Size
    By bradszy in forum Windows Programming
    Replies: 34
    Last Post: 04-26-2008, 07:09 AM
  3. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  4. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM