Subject: Re: [boost] [GSoC] [Boost.Hana] Formal review request
From: pfultz2 (pfultz2_at_[hidden])
Date: 2014-08-03 09:56:55
> Could you post an example? Is the concept check done in the return type
> as with enable_if?
In C++11, we can use a default template parameter, rather than the return
type, which is what the `CONCEPT_REQUIRES_` uses. So for example, we can
auto foo(T&&... xs)
This works as long as all the varidiac template types are to be deduced by
compiler. For classes this won't work:
Because you can't have a default template parameter after the varidiac
template parameters in this context(you can when using speczializations).
Of course, you can't use `CONCEPT_REQUIRES_` for class specialization. In my
library, I do provide a `TICK_CLASS_REQUIRES` which can be used for class
specializations. Note that since it relies on `enable_if` it won't resolve
ambiguities like Concepts Lite will. For example:
// Here we have to add a check for `RandomAccessIterator` to avoid
Perhaps, there is a way to this using tag dispatching, I'm not sure.
-- View this message in context: http://boost.2283326.n4.nabble.com/Re-GSoC-Boost-Hana-Formal-review-request-tp4665622p4665967.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk