|
Boost : |
Subject: Re: [boost] [GSoC] [Boost.Hana] Formal review request
From: Michael Shepanski (mps_at_[hidden])
Date: 2014-08-03 05:05:08
On 3/08/2014 5:58 PM, Roland Bock wrote:
> namespace detail
> {
> template<typename... T>
> struct wrong
> {
> using type = std::false_type;
> };
> }
> template<typename... T>
> using wrong_t = typename detail::wrong<T...>::type;
>
> It can be used to defer static_assert until a template is instantiated
> which is an error since it is prohibited:
>
>
> // disabled default case, slightly shortened from [2]
>
> template<typename Context, typename T>
> struct serializer_t
> {
> static_assert(wrong_t<serializer_t>::value,
> "missing serializer specialization");
> };
I saw this in your "template toffees" talk and I wondered then whether
it wouldn't be simpler to do this:
template<typename Context, typename T, bool deferred_false = false>
struct serializer_t
{
static_assert(deferred_false, "missing serializer specialization");
};
--- Michael
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk