Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2004-01-27 11:06:22

Howard Hinnant wrote:
> On Jan 26, 2004, at 4:59 PM, Daniel Wallin wrote:
>> Howard Hinnant wrote:
>>> <snip>
>>> And I submit that:
>>> S<T[], my_deleter>
>>> is more elegant syntax than:
>>> S_array<T, my_deleter>
>> FWIW, I'm not sure it's a good idea to design the interface around
>> partial specialization. std::vector<> replaces almost every possible
>> need for array allocation, so does this use case really need to be
>> less verbose? Is it worth dropping support for older compilers?
> Need to be? No. But I still like it. <shrug> I was convinced
> because that's how a newbie expected it to work.

I'm starting to not like it. :-) The problem is:

    template<class X> void f(S_ptr<X> px);

where f doesn't support arrays. A reasonably common occurence. S_array<>
doesn't match, but S_ptr<T[]> does. The author of f would need to learn
about enable_if to prevent array pointers from being passed to f. This is
not good, although the exact degree of not-goodness is somewhat debatable.

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