Boost logo

Boost :

From: Andy Little (andy_at_[hidden])
Date: 2006-08-14 16:10:45


"Joel de Guzman" wrote
> Andy Little wrote:
>> "Andreas Pokorny" wrote

>>> template<typename EnableIfT>
>>> struct
>>> rule<example_domain,bitor_tag,TYPE_WHICH_ENCODES_THE_EXPRESSION,C,EnableIfT>
>>> : defined, mpl::true_
>>> {
>>> typedef TYPE_WHICH_ENCODES_THE_WHOLE_TREE result_type;
>>> static result_type init(A const& a, B const& b) { return
>>> result_type(...); }
>>> };
>>
>> I don't understand what these TYPE_WHICH_ENCODES_THE macros are, but can 't
>> you
>> use Boost.Typeof for this?
>
> IIUC, the "rule" specifies the result type (not deduces the
> result type). I think it's not a macro at all; it would rather
> be something like: "unspecified_type", or
> "you-define-your-type-here-and-ill-do-the-rest"

Well again I am probably not understanding it fully, but from one of Andreas
posts higher in the thread:

get_result_type<add_tag,LeftT,RightT>

presumably could be implemented as:

template <typename LeftT, typename RightT>
struct get_result_type<add_tag,LeftT,RightT>
{
    typedef BOOST_TYPEOF_TPL(LeftT() + RightT()) type;
};

Anyway apologies if I have missed the point.

regards
Andy Little


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