Subject: Re: [boost] [GSoC] [Boost.Hana] Formal review request
From: pfultz2 (pfultz2_at_[hidden])
Date: 2014-08-03 09:37:26
> b) You have one or more full or partial class specializations for
> specific classes/templates/values:
> Basically as above, but if you want to prohibited the default case or
> certain specializations, here's a nice, minimalistic helper to do so
This is a perfect example of when *not* to use static_assert. You should
the class undefined:
template<typename Context, typename T, typename Enable = void>
Then the compiler will already give a simple and informative error about the
class being undefined, which is almost the same error you put in the
Futhermore, say I want to know if there is a valid serializer at
and if not then choose a different method. So, I create a predicate to
a valid serializer:
template<class Context, class T>
auto requires_(Context ctx, const T& x) -> decltype(
has_type<typename Context::T, T>(),
Unfortunately, this won't work because of the hard error, and it won't work
with Concepts Lite either.
`static_assert` can be used to check variants outside of type requirements,
in general, it should not be used for type requirements.
-- View this message in context: http://boost.2283326.n4.nabble.com/Re-GSoC-Boost-Hana-Formal-review-request-tp4665622p4665966.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