
--- In Boost-Users@yahoogroups.com, David Abrahams
Stephen Love
writes: Hi all,
Using Borland C++Builder5 (which has bcc32 5.5.1) I've attempted the tests for indirect_iterator which compile fine. However, the following fails:
list< shared_ptr< int > > ctr;
void foo( int x ) { }
for_each( make_indirect_iterator( ctr.begin() ), make_indirect_iterator( ctr.end() ), foo );
with the first error being:
[C++ Error] iterator.h(125): E2404 Dependent type qualifier 'shared_ptr<int>' has no member type named 'difference_type'
which then causes a failure to instantiate the iterator_traits. I'm no template guru, so I can make the full error list available if required. Anyone know what's going on?
The current official Boost indirect_iterator doesn't work with smart pointers as advertised. A much improved easier-to-use iterator adaptor library, which does, can be found in the Boost Sandbox CVS:
http://www.boost.org/more/mailing_lists.htm#sandbox
See the boost/iterator and libs/iterator subdirectories.
Documentation at:
http://www.boost-consulting.com/writing/facade-and-adaptor.html
It will replace the existing iterator adaptors before the next Boost release.
HTH, -- Dave Abrahams Boost Consulting www.boost-consulting.com
Sounds like the solution I've been looking for today. Any news on when the next release of boost will be that will include this? Regards, Drew Tennenbaum