Opened 11 years ago

Closed 11 years ago

#6276 closed Bugs (invalid)

is_sorted() concept check fails in eval_if<>

Reported by: JonT Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost Development Trunk Severity: Regression
Keywords: is_sorted eval_if Cc:

Description

The following worked in 1.38, but fails to compile in 1.45, 1.47 and head.

#include <vector>
#include <algorithm>
#include <boost/detail/algorithm.hpp>


void testfunc()
{
        std::vector<double> myVec(100);
                        
        if (!boost::is_sorted(myVec.begin(),myVec.end()) )
        {
                /* empty */
        }
}

The error log is attached.

Attachments (1)

boost-is-sorted-build.log (17.2 KB ) - added by JonT <jon@…> 11 years ago.
build log of compile errors

Download all attachments as: .zip

Change History (3)

by JonT <jon@…>, 11 years ago

Attachment: boost-is-sorted-build.log added

build log of compile errors

comment:1 by JonT <jon@…>, 11 years ago

Test case compiles in 1.42 but not 1.43

comment:2 by Neil Groves, 11 years ago

Resolution: invalid
Status: newclosed

This isn't a defect. The compile-log shows a reasonably clear indication that iterators are being based in to an algorithm that requires a model of the SinglePassRange concept.

Your code should read:

if (!boost::is_sorted(myVec)) { }

Note: See TracTickets for help on using tickets.