Boost logo

Boost Users :

From: Pranckevicius, Tadas (tadas.pranckevicius_at_[hidden])
Date: 2006-06-09 12:18:57


-----Original Message-----
From: Sebastian Redl [mailto:sebastian.redl_at_[hidden]]
Sent: 09 June 2006 16:22
To: boost-users_at_[hidden]
Subject: Re: [Boost-users] Boost.Signals: strange bug in example program

Pranckevicius, Tadas wrote:

>I tried to run this example and I got the same results, it prints 8 on
>Microsoft Visual studio 2003 (7.1) as well.
>
>I did try to debug it and ended up in "algorithm" file:
>
>After adding cout:
>
>template<class _FwdIt> inline
> _FwdIt _Max_element(_FwdIt _First, _FwdIt _Last)
> { // find largest element, using operator<
> _DEBUG_RANGE(_First, _Last);
> _FwdIt _Found = _First;
> cout<<*_Found<<endl;
> if (_First != _Last)
> for (; ++_First != _Last;) {
> cout<<*_First <<endl;
> if (_DEBUG_LT(*_Found, *_First))
> _Found = _First;
> }
> return (_Found);
> }
>
>
>My Visual Studio.Net 2003 does not even have this function anywhere in
>the include directory. What precise version are you using? Have you
>replaced your standard library?

>Sebastian Redl

Sorry for the confusion I have debugged in VS 2005

In VS2003 it is:
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\algorithm
And it looks like:

template<class _FwdIt> inline
        _FwdIt max_element(_FwdIt _First, _FwdIt _Last)
        { // find largest element, using operator<
        _FwdIt _Found = _First;
        if (_First != _Last)
                for (; ++_First != _Last; )
                        if (*_Found < *_First)
                                _Found = _First;
        return (_Found);
        }

And gives the same result...

thanks


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net