Boost logo

Boost :

From: Matthew Wilson (MWilson_at_[hidden])
Date: 2002-05-15 19:59:25


Jeremy

Compiling with CV6 gives the following:

minmax.cpp
c:\program files\microsoft visual studio\vc98\include\utility(81) : error C2039: 'iterator_category' : is not a member of '`global namespace''
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(81) : error C2146: syntax error : missing ';' before identifier 'iterator_category'
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(81) : error C2868: 'iterator_category' : illegal syntax for using-declaration; expected qualified-name
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(82) : error C2039: 'value_type' : is not a member of '`global namespace''
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(82) : error C2146: syntax error : missing ';' before identifier 'value_type'
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(82) : error C2868: 'value_type' : illegal syntax for using-declaration; expected qualified-name
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(83) : error C2039: 'distance_type' : is not a member of '`global namespace''
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(83) : error C2146: syntax error : missing ';' before identifier 'distance_type'
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled
c:\program files\microsoft visual studio\vc98\include\utility(83) : error C2868: 'distance_type' : illegal syntax for using-declaration; expected qualified-name
        W:\scratch\test\minmax\minmax.cpp(137) : see reference to class template instantiation 'std::iterator_traits<class custom *>' being compiled
        W:\scratch\test\minmax\minmax.cpp(156) : see reference to function template instantiation 'void __cdecl test_range(class custom *,class custom *,int,char *)' being compiled

Does your library require a better STL such as STLport, or is it intended to work with the stl implementation shipped with VC6?

Matthew Wilson

-----Original Message-----
From: Jeremy Siek [mailto:jsiek_at_[hidden]]
Sent: Thursday, 16 May 2002 5:33 AM
To: boost_at_[hidden]
Subject: Re: [boost] minmax library proposal

Hi Herve,

Sounds like a good addition to the algorithms. I'll check this stuff into
the boost-sandbox.

Cheers,
Jeremy

On Mon, 13 May 2002, Herve Bronnimann wrote:

hbr> Hello boosters:
hbr>
hbr> I've recently assigned and completed a homework, an extension of
hbr> std::min_element and std::max_element. I've put in the Files section of
hbr> the Boost.org website (under non-capitalized minmax_element) and also
hbr> created a Wiki entry in STLAlgorithmExtensions for recording the
hbr> discussion.
hbr>
hbr> I sollicit your feedback and, if nobody objects, would like to propose
hbr> this as a boost library. It's a single file <boost/minmax.hpp>.
hbr>
hbr> The story is, minmax_element does the work of both min_element and
hbr> max_element, in a single traversal and using only 3n/2+1 comparisons.
hbr> Experimentally, it's just a tad slower than min_element alone. The
hbr> algorithm is well known, but I found it quite tricky to implement
hbr> correctly (esp. when elements can be identical and you want to return
hbr> the FIRST occurence of both min and max). Try it!
hbr>
hbr> Everything else is on the web site:
hbr>
hbr> http://groups.yahoo.com/group/boost/files/minmax_element/
hbr>
hbr> Please reply to me directly as well as the mailing list, as I read the
hbr> boost digest only (and not that frequently).
hbr> --
hbr> Herve Bronnimann
hbr> Assistant Professor, Computer Science Dept
hbr> Polytechnic University Tel (718) 260 3538
hbr> Six Metrotech Center Fax (718) 260 3609
hbr> Brooklyn, NY 11201 http://photon.poly/edu/~hbr/
hbr>
hbr> _______________________________________________
hbr> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
hbr>

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk