Boost logo

Boost :

Subject: Re: [boost] Tick: Trait instrospection and concepts library now for C++11
From: pfultz2 (pfultz2_at_[hidden])
Date: 2014-06-07 01:18:35

> Does your library define just traits or try to emulate Concept Lite?

I'm not quite sure what you are asking. The library doesn't do everything
Concepts Lite does. It lets you define concept-like predicates(commonly
called a
type trait in C++) in a similiar manner as Concepts Lite does. It does do
template constraints as well, but this is just done using `enable_if`. Also,
won't resolve ambiguity between overloads like Concepts Lite does. However,
I am
thinking about implementing a mechanism for this. Perhaps something like

    struct advance1
        template<class Iterator>

        template<class Iterator>
        void operator()(Iterator& it, int n) const
            it += n;


    struct advance2
        template<class Iterator>

        template<class Iterator>
        void operator()(Iterator& it, int n) const
            while (n--) ++it;


    tick::overload<advance1, advance2> advance = {};

However, this is fairly verbose even with the help of macros. It just might
easier to add some `not`s to the requires clause.

Now, non-template members can be disabled, but they need to be made
like this:

    template<class Base>
    struct A : Base
        template<class Self=A, TICK_REQUIRES(is_incrementable<Self>())
        void increment()

However, the library cannot be used with special members(such as copy
constructors, move constructors, and assignment operators). This is a
of the language, since these special members cannont ever be templates.
might be a way to workaround the issue using universal references. I haven't
really looked into it.


View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at