Boost logo

Boost :

From: Marcelo E. Magallon (mmagallo_at_[hidden])
Date: 2003-05-27 04:20:02

On Tue, May 27, 2003 at 10:32:47AM +0200, Marcelo E. Magallon wrote:

> I'm chasing this one down. Looking at the preprocessor output I see
> the accessors R_component_* being defined but for some reason the
> compiler can't find them. Reece, have you made any progress?

 I'm baffled. The compiler says:

/usr/include/boost/math/quaternion.hpp: In function `boost::math::quaternion<T>
   boost::math::quaternion<U>&) [with T = float, U = double]':
/usr/include/boost/math/quaternion.hpp:866: instantiated from here
/usr/include/boost/math/quaternion.hpp:449: error: `R_component_1' undeclared
   (first use this function)

 Looking at the preprocessor output, this is the problem code:


    explicit quaternion(quaternion<double> const & a_recopier)
-> *this = detail::quaternion_type_converter<float, double>(a_recopier);

 Notice this is a specialization. detail::quaternion_type_converter is
 defined as:

    namespace detail

        template< typename T,
                    typename U
        quaternion<T> quaternion_type_converter(quaternion<U> const & rhs)
            return(quaternion<T>( static_cast<T>(rhs.R_component_1()),

 The following code appears _before_ in the file:

namespace boost
    namespace math
        template<typename T>
        class quaternion


            T real() const { return(a); } quaternion<T> unreal() const { return(quaternion<T>(static_cast<T>(0),b,c,d)); } T R_component_1() const { return(a); } T R_component_2() const { return(b); } T R_component_3() const { return(c); } T R_component_4() const { return(d); } ::std::complex<T> C_component_1() const { return(::std::complex<T>(a,b)); } ::std::complex<T> C_component_2() const { return(::std::complex<T>(c,d)); }

 The specialization for float and double appears _after_ the problem

 I have double checked that G++ 3.2 does compile the code. Regression
 in 3.3?



Boost list run by bdawes at, gregod at, cpdaniel at, john at