Menu

#3 transform_iterator not compiling with december update

open
nobody
None
5
2007-12-21
2007-12-21
No

The following code compiles with CodeGear C++Builder Update3, but fails to compile with the December update of CodeGear C++Builder.

//-----------------------------------------------------
#include <functional>
#include <boost/iterator/transform_iterator.hpp>
#pragma hdrstop

//-----------------------------------------------------

struct A
{
int a;
};

struct B
{
int b;
};

struct AToB : std::unary_function<A, B>
{
result_type operator()(argument_type arg)
{ B b = { arg.a }; return b; }
};

#pragma argsused
int main(int argc, char* argv[])
{
A data[] = { { 1 }, { 2 }, { 3 } };
boost::transform_iterator<AToB, A *> iter(data);
return 0;
}
//-----------------------------------------------------

Discussion


Log in to post a comment.