Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2004-01-21 17:25:09


On Jan 21, 2004, at 4:46 PM, Daryle Walker wrote:

> I think the reverse; that "S<T[]>" is worse, because it's
> anti-intuitive!
> When I see a specialization, I think of something that has the same
> interface, but with some sort of optimized implementation. Your idea
> is bad
> because you're deliberately giving this specialization a _different_
> interface. It's worse than the "std::vector<bool> sucks compared to
> the
> unspecialized std::vector<T>" quirk (vector's problem is in the subtle
> difference in the dereferencing interfaces).

<nod> I understand your position.

But with vector<bool> there's no obvious visual indicator that says:
Hey, there's something different going on here!

With move_ptr<T[]> you (or at least I) immediately think: Ok, a smart
pointer to an array.

Intuitive? I must admit that I unceremoniously stole the idea. I
stole it from a complete C++ newbie on comp.lang.c++:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF
-8&selm=ErM46.13826%24534.6573%40newsfeed.slurp.net

----
From: Luca (luca_at_[hidden])
Subject: auto_ptr question
Newsgroups: comp.lang.c++
Date: 2001-01-03 13:03:14 PST
Can auto_ptr handle raw arrays properly?
auto_ptr<char []> ptr(new char[100]);
Will the array be properly deleted when ptr goes out of scope?
TIA
Luca
----
The guy looked like smart pointer prodigy to me. :-)
-Howard

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