Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2002-02-08 18:13:51


> Hi Boosters,
>
> Another not cool thing I have see in BOOST,
> And again better implementation exists in CodeWarrior.
>
> In BOOST you have 2 version of scope_ptr<>
> One for single object, and one for array.
>
> CodeWarrior use small traits
>
> class Single_
> {
> destroy { delete p; }
> }
>
> class Array_
> {
> destroy { delete [] p; }
> }
>
> And in scope_ptr they add one more parameter to template:
>
> template <class T, class traits = Single_ >
> scope_ptr
> {
> ~scope_ptr() { traits::destroy(p_); }
> }

And how would you deal with operator[] ?


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