Boost logo

Boost :

Subject: Re: [boost] [alogrithm] compile error with VS2008 in debug build (boost 1.38)
From: Daniel Hulme (st_at_[hidden])
Date: 2009-02-18 08:43:19

On Wed, Feb 18, 2009 at 12:52:38PM +0100, Hansi wrote:
> Is something wrong in my program?


> typedef array<int,100000000> dataarray;
> void do_tests(dataarray& data)
> {
> {
> timer t;
> std::pair< std::vector<int>::iterator, std::vector<int>::iterator >
> result = boost::minmax_element(data.begin(), data.end());

This line should be
std::pair< dataarray::iterator, dataarray::iterator >
    result = boost::minmax_element(data.begin(), data.end());

minmax_element might be clever, but it can't magically turn
boost::array's iterators into std::vector's iterators.

Always crash crash crash                    Well come on and let me know
You're happy when I'm running bash       Should I play or should I code?
One test is fine, next is black            (with apologies to The Clash)
So if you want a dodgy hack      worse at

Boost list run by bdawes at, gregod at, cpdaniel at, john at