From: Andy Little (andy_at_[hidden])
Date: 2006-07-25 03:39:09
IMO the Integral Constant Concept is over specified in the mpl docs.
What is the rationale behind the next<..> and prior <..> requirements?
These seem to have little to do with an Integral Constant. Maybe they should
rather be another Concept , such as Iterable?
Where N is a model of Iterable:
Currently for example, mpl::bool_ is stated to be a model of Integral Constant,
but it fails to meet the curently stated requirments, nor can it ever AFAICS.
Further the requirements currently include a member ::value_type.
According to the TMP book, this is a classic example of a traits blob. (section
Surely access should be specified using value_type<C>::type?
IOW maybe a ValueType Concept.
Finally the runtime evaluation requirement could be removed and a refinement of
such as RunTime Evaluable be stated in terms such as:
Where T is a type modelling Runtime Evaluable
value_type<T>::type = t();
For a type N The current Integral Constant spec would then, in those places
where these requirements are required:
N is a model of Iterable, Integral Constant and Runtime Evaluable.
This would allow me to meet the new Integral Constant requirements without
Further a bool_ could be correctly specified in terms of the above Concepts
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk