|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2005-07-15 06:33:35
"Arkadiy Vertleyb" <vertleyb_at_[hidden]> wrote
> "Andy Little" <andy_at_[hidden]> wrote
>> Surely Typeof is used in situations where semicolon not allowed:
>>
>> template<typename TL, typename TR>
>> point<BOOST_TYPEOF_TPL(TL() + TR())>
>> operator +( point<TL> const & lhs, vect<TR> const& rhs);
>
> No, what I actually mean is:
>
> BOOST_TYPEOF_REGISTER_TYPE(...)
> BOOST_TYPEOF_REGISTER_TEMPLATE(...)
Oops soory. However this identifies a point which I dont think has been made in
this discussion. A generic macro is just a shapeless blob standing in for some
text. Therefore I dont see it is possible to make general rules such as to
whether a trailing semicolon is included. There is simply not enough definition.
One would have to classify the *class* of macro rigorously (probably via the
grammar) first. eg is this macro representing a typeid, an
assignment-expression etc. Isnt this really what we are discussing ... fitting
a macro into the grammar of the language? Identify the *class* of macro in the
grammar to identify whether it is possible to use a particular macro in
situations where a semicolon is not required, or whether the semicolon is always
necessary, hence rightfully included as part of the macro.
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