|
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::detail::quaternion_type_converter(const
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:
/usr/include/boost/math/quaternion.hpp:866:
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()),
static_cast<T>(rhs.R_component_2()),
static_cast<T>(rhs.R_component_3()),
static_cast<T>(rhs.R_component_4())));
};
}
The following code appears _before_ in the file:
namespace boost
{
namespace math
{
template<typename T>
class quaternion
{
public:
[...]
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
code.
I have double checked that G++ 3.2 does compile the code. Regression
in 3.3?
Hints?
-- Marcelo
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk