Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2008-07-16 07:56:29


On Jul 14, 2008, at 11:31 AM, J. van der Wulp wrote:

> There seems to be a problem with using Boost.Integer in combination
> with anything that uses boost/detail/numeric_traits.hpp
> (development). The latter also defines a struct with name
> integer_traits that is not compatible with the one declared in
> Boost.Integer.
>
> The problem can be reproduced by including boost/graph/
> adjacency_list.hpp first and boost/integer.hpp as in:
>
> #include <boost/graph/adjacency_list.hpp>
> #include <boost/integer.hpp>
>
> int main() {
> return 0;
> }
>
> Swapping the include directives avoids the problem.

Does it have to be <boost/integer.hpp>, or will using <boost/
integer_traits.hpp> directly (without also including integer.hpp)
also cause the error? (Check both relative orders, of course.)

I wonder if changing numeric_traits to:

//=========================================
   template <class Number>
   struct numeric_traits
   {
       typedef
typename ::boost::detail::integer_traits<Number>::difference_type
difference_type;
   };
//=========================================

will make a difference. The extra qualification should specify
exactly which "integer_traits" is used. (It was unqualified before,
so maybe the compiler grabs boost::integer_traits if it doesn't know
about boost::detail::integer_traits.)

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT hotmail DOT com

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