$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Daniel Wallin (dalwan01_at_[hidden])
Date: 2003-09-15 17:50:39
At 22:17 2003-09-15, Howard Hinnant wrote:
>On Sep 15, 2003, at 3:36 PM, Daniel Wallin wrote:
>
>>At 19:37 2003-09-15, Eric Friedman wrote:
>>>Howard Hinnant wrote:
>>> > Like Daniel, I recommend the enable_if pattern here, but I would do it
>>> > like:
>>> >
>>> >    struct test_t
>>> >    {
>>> >        template <typename T>
>>> >        test_t(T&, typename enable_if<!is_const<T>::value>::type* = 0)
>>> >        {
>>> >        }
>>> >
>>> >        template <typename T>
>>> >        test_t(T&, typename enable_if<is_const<T>::value>::type* = 0)
>>> >        {
>>> >        }
>>> >    }
>>>
>>>Unfortunately, this prevents construction from temporaries.
>>
>>FWIW, the workaround I posted doesn't.
>
><nod> Right.  Your solution is problematic with CodeWarrior Pro 9 / 
>Mac.  It compiles, but both the reference and const reference tests bind 
>to test_t(const T&).
Oh, ok. What specifically is causing this? Broken partial ordering or 
broken SFINAE? If it's the
partial ordering, does it help to add a parameter with a default value to 
the const T& overload as well?
--- Daniel Wallin