or for that matter, do you have the latest VC++ 6.0 service pack installed? SP5 was the last one I saw.
or for that matter, do you have the latest VC++ 6.0 service pack installed? SP5 was the last one I saw.
>> ya i have done that, but i am still having that problem..
Can you post that code so we can test it out? I don't have time to make a complete example, but if you posted one I or others might be able to test it out in VC++ 6.0 to see if it is a problem everywhere or just your configuration.
there was at least 6SP5 was the last one I saw
http://www.microsoft.com/downloads/d...displaylang=en
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
Yes vart I think that might be the problem..
I will check that..
I do not remember any major STL issues between 6, 2003 .NET and 2005 .NET save for more standardized behavior under the hood.
My vector code from 6 ported to 2003 and 2005 just fine.
This is a defect in the STL implementation that ships with VC 6.0.
You could work around the defect like so:
But a better suggestion is to use another STL implementation like STLport.Code:vector<int> v1; ... vector<int> v2(v1.size()); std::copy(v1.rbegin(), v1.rend(), v2.begin());
http://www.stlport.org/
gg
I DIDNT GET WHAT "STL implementation " MEANS?
SHOUL I REINSTALL VISUAL STUDIO 6?
It means that there is a bug in the way in which Microsoft (or the company they hired) implemented or programmed the standard template library. I probably did not touch this part of the STL impl in my code which is why I never had trouble.
you should verify that
VS is installed
SP6 is installed
Platform SDK is installed
Platform SDK paths are shown in a first row in the Tools/Options/directories for Bin/Lib/Include dirs
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
– David J. Wheeler
C++ compilers come shipped with the standard library of classes, functions, etc, that you use in your program. That library is referred to as the implementation. Your STL implementation is just the standard library code that came with your compiler.
It is possible to switch to another library without changing your compiler. That is what Codeplug and others are suggesting. However, that is a major change, and if your customer is unwilling or unable to change from VC++ 6.0, then they might not want to change their standard library implementation either. If they were willing to change, they should just upgrade to a modern compiler that comes with a modern standard library.
Reinstalling won't help, since Codeplug is saying that there is a bug in the VC++ library, so even if you reinstall it will still be there.
I would suggest using the workaround he suggested and trying to convince your customer to allow you to use a modern compiler. VC++ 2003 (version 7.1) is very good, and VC++ 2005 Express is also good and free. There is even a VC++ 2008 out now that should be considered.
thanks for all the help, i will try to find solution based on your suggestions....
I have MSVC 6 on a computer, here are the first couple dozen lines of code from the vector header file (SP6), pay attention to the lines I've colored (they are the constructors):
Those are the only constructors that I found in the file and you should notice that there is no version of the constructor that seems to handle reverse iterators. The last one does seem to handle forward iterators, but no reverse iterator version seems to exist. I could have missed something though, didn't look under every rock.Code:// vector standard header #if _MSC_VER > 1000 #pragma once #endif #ifndef _VECTOR_ #define _VECTOR_ #include <climits> #include <memory> #include <stdexcept> #include <xutility> #ifdef _MSC_VER #pragma pack(push,8) #endif /* _MSC_VER */ _STD_BEGIN // TEMPLATE CLASS vector template<class _Ty, class _A = allocator<_Ty> > class vector { public: typedef vector<_Ty, _A> _Myt; typedef _A allocator_type; typedef _A::size_type size_type; typedef _A::difference_type difference_type; typedef _A::pointer _Tptr; typedef _A::const_pointer _Ctptr; typedef _A::reference reference; typedef _A::const_reference const_reference; typedef _A::value_type value_type; typedef _Tptr iterator; typedef _Ctptr const_iterator; typedef reverse_iterator<const_iterator, value_type, const_reference, _Ctptr, difference_type> const_reverse_iterator; typedef reverse_iterator<iterator, value_type, reference, _Tptr, difference_type> reverse_iterator; explicit vector(const _A& _Al = _A()) : allocator(_Al), _First(0), _Last(0), _End(0) {} explicit vector(size_type _N, const _Ty& _V = _Ty(), const _A& _Al = _A()) : allocator(_Al) {_First = allocator.allocate(_N, (void *)0); _Ufill(_First, _N, _V); _Last = _First + _N; _End = _Last; } vector(const _Myt& _X) : allocator(_X.allocator) {_First = allocator.allocate(_X.size(), (void *)0); _Last = _Ucopy(_X.begin(), _X.end(), _First); _End = _Last; } typedef const_iterator _It; vector(_It _F, _It _L, const _A& _Al = _A()) : allocator(_Al), _First(0), _Last(0), _End(0) {insert(begin(), _F, _L); }
"Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
-Christopher Hitchens
A reverse_iterator works like any other iterator and should be handled by the last constructor show, correct?
The Standard specifies that constructor as:
Since VC++ 6.0 doesn't support template constructors very well (if at all), they just implemented a vector::const_iterator version of the constructor.Code:template <class InputIterator> vector(InputIterator first, InputIterator last, const Allocator& = Allocator());
gg