transform_iterator requirement on the Iterator?
Hi,
From the docs, I don't see the Iterator argument is required to be default-constructible.
I have a gcc4.3.3 error stack that looks like:
/usr/include/boost-1_37/boost/iterator/iterator_adaptor.hpp: In constructor
'boost::iterator_adaptor
2009/9/10 Hicham Mouline
From the docs, I don't see the Iterator argument is required to be default-constructible.
By Table 74 in the standard, all forward iterators are required to be default-constructible. I doubt you want your container iterators to be input iterators, and regardless, lower_bound requires forward iterators.
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of Scott McMurray Sent: 10 September 2009 15:23 To: boost-users@lists.boost.org Subject: Re: [Boost-users] transform_iterator requirement on the Iterator?
2009/9/10 Hicham Mouline
: From the docs, I don't see the Iterator argument is required to be default-constructible.
By Table 74 in the standard, all forward iterators are required to be default-constructible.
I doubt you want your container iterators to be input iterators, and regardless, lower_bound requires forward iterators. _______________________________________________
My iterators are constructed to make them point inside a given container, for that they store a reference to the container. Therefore I cannot provide a default constructor, or can I? Do I need to change the implementation of the iterator to allow default construction so that I can use lower_bound with it?
2009/9/10 Hicham Mouline
My iterators are constructed to make them point inside a given container, for that they store a reference to the container. Therefore I cannot provide a default constructor, or can I?
Do I need to change the implementation of the iterator to allow default construction so that I can use lower_bound with it?
The default constructor is expected to give a mostly-useless singular iterator. Changing the reference to a pointer should solve everything.
participants (2)
-
Hicham Mouline
-
Scott McMurray