Boost logo

Ublas :

Subject: Re: [ublas] Proposed change: use BOOST_TYPEOF
From: Gunter Winkler (guwi17_at_[hidden])
Date: 2009-10-09 14:05:44


Neal Becker schrieb:
> Since we have BOOST_TYPEOF, use it in type_traits.hpp:
>
> template<class X, class Y>
> struct promote_traits {
> typedef type_deduction_detail::base_result_of<X, Y> base_type;
> static typename base_type::x_type x;
> static typename base_type::y_type y;
> // static const std::size_t size = sizeof (
> // type_deduction_detail::test<
> // typename base_type::x_type
> // , typename base_type::y_type
> // >(x + y) // Use x+y to stand of all the arithmetic
> actions
> // );
>
> // static const std::size_t index = (size / sizeof (char)) - 1;
> // typedef typename mpl::at_c<
> // typename base_type::types, index>::type id;
> // typedef typename id::type promote_type;
> // typedef typeof (X() + Y()) promote_type;
> typedef BOOST_TYPEOF (X() + Y()) promote_type;
> };
>
>
>
This sounds very useful. The provided return type deduction was only
introduced because BOOST_TYPEOF was not available at this time.

mfg
Gunter