[Boost-bugs] [Boost C++ Libraries] #3442: tracking level etc. for templates

Subject: [Boost-bugs] [Boost C++ Libraries] #3442: tracking level etc. for templates
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-09-12 16:46:16


#3442: tracking level etc. for templates
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner: ramey
     Type: Feature Requests | Status: new
Milestone: Boost 1.41.0 | Component: serialization
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 changing the tracking level/class implementation for tempaltes is very
 tedious to write and reveals implementation details to the user, so I'm
 suggesting the following macro:

 template<class T,int i> class mytype{};

 BOOST_CLASS_TRACKING_TEMPLATE(mytype,2,(class,int),track_never);

 the implementation is fairly simple:

 #define TYPE_TO_PAR(R,DATA,I,ELEM) (ELEM _A##I)
 #define PAR_SEQ(NR,PARS)
 BOOST_PP_SEQ_FOR_EACH_I(TYPE_TO_PAR,0,BOOST_PP_TUPLE_TO_SEQ(NR,PARS))
 #define PARS(NR,PARS) BOOST_PP_SEQ_ENUM(PAR_SEQ(NR,PARS))
 #define ARGS(NR) BOOST_PP_ENUM_PARAMS(NR,_A)

 #define BOOST_CLASS_TRACKING_TEMPLATE(T,NR,P,TRACKING) \
 template<PARS(NR,P)>
 struct tracking_level<T<ARGS(NR)> >
 {
     typedef mpl::integral_c_tag tag;
     typedef mpl::int_<TRACKING> type;
     BOOST_STATIC_CONSTANT(
         int,
         value = tracking_level::type::value
     );
 };

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3442>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC