Boost logo

Boost :

From: Stephan T. Lavavej (stl_at_[hidden])
Date: 2005-07-27 22:10:07


[STL]
> I have noted the following about Boost 1.32.0.
> 1. boost/token_iterator.hpp is very broken on line 34.
>
> template <class TokenizerFunc, class Iterator, class Type>
> class token_iterator
> : public iterator_facade<
> token_iterator<TokenizerFunc, Iterator, Type>
> , Type // ********** SHOULD READ: const Type
> , typename detail::minimum_category<
> forward_traversal_tag
> , typename iterator_traversal<Iterator>::type
> >::type
> , const Type&
> >
>
> GCC 3.4.2 refuses to compile this when broken.

[Dave Abrahams]
> Why do you think so?

I'm sorry, I misremembered it as a hard error. Actually, it produces a
nontrivial warning under -Wcast-qual:

C:/MinGW/bin/../lib/gcc/i686-pc-mingw32/3.4.2/../../../../include/boost/iter
ator/iterator_facade.hpp: In static member f
unction `static typename boost::mpl::if_<boost::is_reference<Reference>,
Pointer, boost::detail::operator_arrow_proxy<Va
lueType> >::type boost::detail::operator_arrow_result<ValueType, Reference,
Pointer>::make(Reference) [with ValueType =
std::basic_string<char, std::char_traits<char>, std::allocator<char> >,
Reference = const std::basic_string<char, std::c
har_traits<char>, std::allocator<char> >&, Pointer = std::basic_string<char,
std::char_traits<char>, std::allocator<char
> >*]':
C:/MinGW/bin/../lib/gcc/i686-pc-mingw32/3.4.2/../../../../include/boost/iter
ator/iterator_facade.hpp:644: instantiated
 from `typename boost::detail::operator_arrow_result<typename
boost::detail::iterator_facade_types<Value, CategoryOrTrav
ersal, Reference, Difference>::value_type, Reference, typename
boost::detail::iterator_facade_types<Value, CategoryOrTra
versal, Reference, Difference>::pointer>::type boost::iterator_facade<I, V,
TC, R, D>::operator->() const [with Derived
= boost::token_iterator<boost::char_separator<char, std::char_traits<char>
>, __gnu_cxx::__normal_iterator<const char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >,
std::basic_string<char, std::char_traits<char>
, std::allocator<char> > >, Value = std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, CategoryOrTr
aversal = boost::forward_traversal_tag, Reference = const
std::basic_string<char, std::char_traits<char>, std::allocator
<char> >&, Difference = ptrdiff_t]'
C:/MinGW/bin/../lib/gcc/i686-pc-mingw32/3.4.2/../../../../include/boost/date
_time/time_parsing.hpp:81: instantiated fr
om `time_duration boost::date_time::parse_delimited_time_duration(const
std::string&) [with time_duration = boost::posix
_time::time_duration]'
C:/MinGW/bin/../lib/gcc/i686-pc-mingw32/3.4.2/../../../../include/boost/date
_time/posix_time/time_parsers.hpp:27: inst
antiated from here
C:/MinGW/bin/../lib/gcc/i686-pc-mingw32/3.4.2/../../../../include/boost/iter
ator/iterator_facade.hpp:325: warning: cast
from `const std::basic_string<char, std::char_traits<char>,
std::allocator<char> >*' to `std::basic_string<char, std::ch
ar_traits<char>, std::allocator<char> >*' discards qualifiers from pointer
target type

Stephan T. Lavavej


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk