$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2008-02-21 14:00:59
Alexander Nasonov <alnsn <at> yandex.ru> writes:
> struct Cases {
> template<class N>
> void operator()(N) const { ... }
>
> void operator()(default_t) const { ... }
> };
>
> The trick posted on RSDN lets me check whether the last call operator
> exists and take this into account.
>
> One useful generalisation of this trick is something like
>
> result_of_with_default<void (Cases)(default_t), no_default_case>
In order for the above to work, Cases::operator()(N) must be more specialised:
struct Cases {
template<int N>
void operator()(mpl::int_<N>) const { ... }
// void operator()(default_t) const { ... }
};
So, result_of_with_default<Cases(default_t), no_default_case>::type
would be no_default_case.
Alex