[typeof] registration question

Hi, folks! In emulation mode, given the following definition: template <typename Container> struct some_metafunction { typedef BOOST_TYPEOF_TPL( Container().insert( typename Container::iterator() , typename Container::value_type() ) ) type; }; Which of the following types need to be registered? 1. The argument passed as `Container` 2. The result of `typename Container::iterator` 3. The result of `typename Container::value_type`

In emulation mode, given the following definition:
I've answered my own question. They all need to be registered. Now I have another question: How should one register a template with the non-type template parameter `std::size_t` (e.g. boost::array)? TIA! Cromwell D. Enage

Cromwell Enage wrote
Now I have another question: How should one register a template with the non-type template parameter `std::size_t` (e.g. boost::array)?
#include <boost/typeof/typeof.hpp> #incldue BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() #include <boost/array.hpp> BOOST_TYPEOF_REGISTER_TEMPLATE(boost::array, (typename)(std::size_t)) http://www.boost.org/doc/libs/1_41_0/doc/html/typeof/refe.html#typeof.regtem... HTH, --Lorenzo -- View this message in context: http://boost.2283326.n4.nabble.com/typeof-registration-question-tp4503815p45... Sent from the Boost - Dev mailing list archive at Nabble.com.

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. Cromwell D. Enage

Cromwell Enage wrote
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.regtem... ``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-tp4503815p45... Sent from the Boost - Dev mailing list archive at Nabble.com.

lcaminti wrote:
It works, indeed.
So THAT's what that macro is used for.
If you use size_t instead of std::size_t then it works even without the INTEGRAL (read 2nd remark same link).
Okay, I just need to be careful in avoiding type ambiguities, e.g. with boost::mpl::size_t. Thanks, again! Cromwell D. Enage
participants (3)
-
Cromwell Enage
-
lcaminiti
-
Steven Watanabe