
AMDG On 07/29/2012 12:28 PM, Fabio Fracassi wrote:
b.2. I cannot define a concept that has more than one function directly, i.e. I have to define concepts for push_back and size and then compose them (in this case 35 lines of code). This is of course mainly an issue of syntactic sugar, but in Stevens concept definition boiler plate and interface information (member name, arguments, composition lists) are intermixed.
I seem to recall that there was some discussion about having some macros to simplify the boilerplate. I think something along the lines of
BOOST_CREATE_CONCEPT(container_concept, typename T, (void (push_back, T), void (size)) )
wouldn't be too bad.
What about this: BOOST_TYPE_ERASURE_MEMBERS((push_back)(size)...) template<class V, class T = _self> struct container_concept : mpl::vector< has_push_back<void(const V&), T>, has_size<std::size_t(), const T>, ...> {}; In Christ, Steven Watanabe