$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
From: Christopher Currie (christopher_at_[hidden])
Date: 2003-11-21 15:36:17
David Abrahams wrote:
>>struct unspecified {};
>>
>>template<class R> class bind_t { };
>>
>>template<class R, class F>
>> bind_t<R>
>> bind(F f);
>>
>>template<class F>
>> bind_t<unspecified>
>> bind(F f);
>>
>>template<class R, class T>
>> bind_t<R const &>
>> bind(R T::* pm)
>>{
>> return bind_t<R const &>();
>>}
>>
>>struct X { int i; };
>>
>>int main() { bind(&X::i); }
>>
>>
>>The Sun compiler is selecting the first partial specialization over
>>the second. If I comment out the first specialization, the code
>>compiles fine, but for some reason it thinks the first is a better
>>match, so it won't link.
>
> These are overloads, not partial specializations, but anyway...
Right, I forget that you can't specialize functions.
> what happens if you reverse their order?
The code seems to compile and link fine if the order is reversed. Is
this a reasonable workaround for Sun? The order shouldn't matter on
other compilers, if it's just a function overload, although given the
large number of bind overloads, it could take some time to find the
order that works on Sun for all cases.
Christopher