Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2002-03-11 09:12:54


On Monday, March 11, 2002, at 08:42 AM, Peter Dimov wrote:

> From: "Howard Hinnant" <hinnant_at_[hidden]>
>> 5. This needs a do-the-right-thing clause <sigh>. Consider:
>>
>> std::vector<double> v(10000UL, 0);
>>
>> This will match:
>>
>> template<class F> vector::vector(size_type n, F f);
>>
>> instead of:
>>
>> vector(size_type, const value_type&);
>
> The way I approach these things is by being explicit:
>
> template<class F> vector::vector(size_type n, init_tag, F f);

If that's not an iron clad argument in favor of restricted templates
then I don't know what is. ;-)

-Howard


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk