HI,

I have a problem about list::sort() in STL (I use Visual C++ 6.0).

Here is a simple example I test, which does not work.

#include <iostream>
#includer<list>

using namespace std;

int main()
{
list<long> L;

for (long i=1;i<=479250; i++)
L.push_back(i);

cout<< L.size()<<endl; // give 479250

L.sort();

cout<< L.size() << endl; // give 20498;???

return 0;
}

Anyone can give me suggestion? Thanks,

ucb

Re: About list::sort() in STL by Alex

Alex
Wed Oct 24 11:39:41 PDT 2007

<gjin@mail.utexas.edu> wrote:
> HI,
>
> I have a problem about list::sort() in STL (I use Visual
> C++ 6.0).

It's a known bug in VC++6.0. Look here for more info and
fix:

"Fixes for Library Bugs in VC++ V5.0/V6.0" section <list>
http://www.dinkumware.com/vc_fixes.html


Alex



Re: About list::sort() in STL by Igor

Igor
Wed Oct 24 11:39:17 PDT 2007

gjin@mail.utexas.edu wrote:
> I have a problem about list::sort() in STL (I use Visual C++ 6.0).
>
> Here is a simple example I test, which does not work.
>
> list<long> L;
>
> for (long i=1;i<=479250; i++)
> L.push_back(i);

http://dinkumware.com/vc_fixes.html , "Fix to <list>" section. While you
are at it, you might want to apply all the other fixes.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925



Re: About list::sort() in STL by gjin

gjin
Wed Oct 24 12:19:45 PDT 2007

On Oct 24, 1:39 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
> g...@mail.utexas.edu wrote:
> > I have a problem about list::sort() in STL (I use Visual C++ 6.0).
>
> > Here is a simple example I test, which does not work.
>
> > list<long> L;
>
> > for (long i=1;i<=479250; i++)
> > L.push_back(i);
>
> http://dinkumware.com/vc_fixes.html, "Fix to <list>" section. While you
> are at it, you might want to apply all the other fixes.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925

Thanks all.

Does anyone suggest me which version of Visual C++ has few bugs
currently?
I can ask my boss to buy it.

ucb


Re: About list::sort() in STL by Alex

Alex
Wed Oct 24 12:50:21 PDT 2007

<gjin@mail.utexas.edu> wrote:
> Does anyone suggest me which version of Visual C++ has
> few bugs
> currently?
> I can ask my boss to buy it.

Most of the readers here will suggest to upgrade to VC++2005
(at least Pro edition). It's the latest VC++ release. Then
apply SP1 to it. However, there is VC++2008 beta out there,
which is currently free.

Alex


Re: About list::sort() in STL by gjin

gjin
Wed Oct 24 14:19:44 PDT 2007

On Oct 24, 2:50 pm, "Alex Blekhman" <tkfx.REM...@yahoo.com> wrote:
> <g...@mail.utexas.edu> wrote:
> > Does anyone suggest me which version of Visual C++ has
> > few bugs
> > currently?
> > I can ask my boss to buy it.
>
> Most of the readers here will suggest to upgrade to VC++2005
> (at least Pro edition). It's the latest VC++ release. Then
> apply SP1 to it. However, there is VC++2008 beta out there,
> which is currently free.
>
> Alex

Thanks a lot, Alex.

ucb


Re: About list::sort() in STL by Giovanni

Giovanni
Wed Oct 24 15:11:42 PDT 2007


<gjin@mail.utexas.edu> ha scritto nel messaggio
news:1193250478.366351.215960@z24g2000prh.googlegroups.com...

> I have a problem about list::sort() in STL (I use Visual C++ 6.0).

To add to what others have written, I would like to suggest you the use of
STLport with Visual C++ 6:

http://www.stlport.org/

It is free, and you can have the power of STL with Visual C++ 6.

There is also Visual C++ 2005 Express Edition, which is free:

http://msdn2.microsoft.com/en-us/express/aa700735.aspx

Of course, it has not got the power of the Pro+ editions, but you can
develop in C++ without MFC or ATL with it.

BTW: I believe that the best IDE for MFC development was the one in VC++6
(thanks to ClassWizard, etc.), so this is why I suggest you STLport with
VC++6.

But if you are not interested in MFC, then you can happily use the more
modern IDEs, which have also better C++ compilers than VC6 one.
Note that Microsoft is focusing to deliver a great IDE for C++ (and MFC)
development with Orcas+1.

Giovanni