[concept_check] convert Concept to trait?
I don't see a place to open issues on
https://github.com/boostorg/concept_check so I am posting this here.
What I want to do is convert a concept into a trait. For example,
given the ForwardIterator concept checking class, I would like to
write:
template<T>
using is_ForwardIterator = std::integral_constant
On 10/4/16 7:55 AM, Vinnie Falco wrote:
I don't see a place to open issues on https://github.com/boostorg/concept_check so I am posting this here.
What I want to do is convert a concept into a trait. For example, given the ForwardIterator concept checking class, I would like to write:
template<T> using is_ForwardIterator = std::integral_constant
; Which aliases to std::true_type if T meets the requirements of ForwardIterator and false otherwise.
Or perhaps a general purpose alias:
template<t> using is_concept
= std::integral_constant ;l Which aliases to std::true_type if T meets the requirements of concept C.
Are such things possible, or perhaps already in the library? My preliminary analysis suggests the answers to these questions are no and no. Has this point been brought up elsewhere, and if so where could I find it?
Regards
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Consider looking at paul fultz's TICK library in the incubator. Robert Ramey
On Tue, 2016-10-04 at 10:55 -0400, Vinnie Falco wrote:
Are such things possible, or perhaps already in the library? My preliminary analysis suggests the answers to these questions are no and no. Has this point been brought up elsewhere, and if so where could I find it?
It's not really possible. Boost.ConceptCheck uses hard errors to check concepts, and then tries to inject the concept name in to the error message to make it clearer why it failed. Alternatively, you can use the Tick library, which is being proposed for Boost. It already has a trait for checking `ForwardIterator`, here: https://github.com/pfultz2/Tick/blob/master/tick/traits/is_forward_iter ator.h Paul
participants (3)
-
paul
-
Robert Ramey
-
Vinnie Falco