Boost logo

Boost :

Subject: Re: [boost] [typeof] registration question
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-04-13 00:53:46


Cromwell Enage wrote
>
>> lcaminti wrote:
>>
>
>> BOOST_TYPEOF_REGISTER_TEMPLATE(boost::array, (typename)(std::size_t))
>
> I tried it.  BOOST_PP_SEQ doesn't like colons in its elements.  Type
> definitions don't work around the problem, either.  For now, the macro
> sequence only accepts typename, class, or one of the fundamental types. 
> So I'm at a loss.
>

This works:

#include <boost/typeof/typeof.hpp>
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
#include <boost/array.hpp>

BOOST_TYPEOF_REGISTER_TEMPLATE(boost::array,
        (typename)(BOOST_TYPEOF_INTEGRAL(std::size_t)))

int main() { return 0; }

Read 3rd remark at:
http://www.boost.org/doc/libs/1_41_0/doc/html/typeof/refe.html#typeof.regtemp

``Enums and typedefs of integral types, need to be described explicitly with
the BOOST_TYPEOF_INTEGRAL macro, like (BOOST_TYPEOF_INTEGRAL(MyEnum))''

If you use size_t instead of std::size_t then it works even without the
INTEGRAL (read 2nd remark same link).

HTH,
--Lorenzo

--
View this message in context: http://boost.2283326.n4.nabble.com/typeof-registration-question-tp4503815p4553858.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

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