Boost logo

Boost :

Subject: [boost] [GSoC] [Checks] Issue with the design
From: Pierre Talbot (pierre.talbot.6114_at_[hidden])
Date: 2011-08-01 15:15:20


Hello everyone.

We talked a few days ago about the design of the check library (about
the compile or run-time weight parameter.)
Reminder : the weights are the contribution to the running sum of a
digit in a number.

I used and followed your ideas and suggestions that bring me to the
policies class.

I tried to extract the characteristics of a "generic" check and the
weight is one of these. So I tried to implement the weight policy
class :

#define _WEIGHT_factory(z,n,unused) \
  template<BOOST_PP_ENUM_PARAMS(n, int weight)> \
  struct weight_policy \
  { typedef typename boost::mpl::vector_c<int BOOST_PP_COMMA_IF(n)
BOOST_PP_ENUM_PARAMS(n, weight)> weight ; } ; \

BOOST_PP_REPEAT_FROM_TO(1,BOOST_CHECK_LIMIT_WEIGHTS,_WEIGHT_factory,~)

#undef _WEIGHT_factory

But the compiler doesn't like the "struct template parameter
overloading". Is a limit of the language ? Or am I doing it in the
wrong way ?
If it's impossible, I though that we could passed the weights to a
function that aimed to "build" the vector_c type.

While we speak about the design, what do you think about the policies
class ? There are useful because the core of the algorithm is the same
for every checks.

Every critics or suggestions are welcomed,

thank you,

Pierre Talbot.


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