|
Boost : |
Subject: Re: [boost] Boost.Hana - Type Classes, data types and categories (tags).
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 2014-09-21 13:17:11
Benedek Thaler <thalerbenedek <at> gmail.com> writes:
>
> On Sat, Sep 20, 2014 at 5:03 PM, Louis Dionne <ldionne.2 <at> gmail.com> wrote:
> [...]
>
> I'm not sure what Niall is referring to, but namespaces come into handy
> when using the swap trick described in effective STL:
>
> template<typename T>
> library_function(T& a, T& b)
> {
> using std::swap;
> swap(a,b); // will use specialized swap in namespace of T if available
> }
Yes, ADL can prove itself useful. However, Hana uses tag dispatching like
Boost.Fusion and Boost.MPL for customization because it deals with objects
of heterogeneous types. Since the actual C++ type of some objects can be
impossible or very cumbersome to pattern match, I don't think ADL is the
right way to go in our case.
Regards,
Louis
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk