Boost logo

Boost :

Subject: Re: [boost] [Hana] Informal review request
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2015-03-05 15:56:27

Matt Calabrese <rivorus <at>> writes:

> On Thu, Mar 5, 2015 at 6:41 AM, Louis Dionne <ldionne.2 <at>> wrote:
> [...]
> I'm sure these problems can be resolved, but I definitely think it is
> important to fully address them before formal review. The subtlety of the
> problems and the ease of misuse makes things really scary to me and I would
> be worried if a lot of library code ended up getting written on top of this
> without solutions in place.
> If any of this is already solved by way of tricks that I'm not aware of (I
> haven't looked through the source yet), then just make sure people know
> that they, too, must utilitze such tricks when making their own hana-style
> metafunctions.

Yes, this is already taken care of and no unfortunate instantiations
will take place. The downside is that `decltype(tuple_t<T...>)` is an
unspecified dependent type that only _inherits_ `_tuple<T...>`.
It is still possible to use pattern matching in overloads as follows:

    template <typename ...T>
    void f(hana::_tuple_t<T...>) {
        // ...

You can see how this is implemented here:
And the unit test here:

I'm playing with fire, I know :-). I read the process of ADL
very carefully when I thought about this, but it is also
possible that I'm exploiting a Clang bug. What do you think?


P.S.: Thanks for letting me know of this issue at C++Now.

Boost list run by bdawes at, gregod at, cpdaniel at, john at