[vtk-developers] Smart pointer declaration macro?

Francois Bertel francois.bertel at kitware.com
Thu Jan 28 10:49:43 EST 2010


Then where is my proposal 5 on your survey?

On Thu, Jan 28, 2010 at 10:37 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> On Thu, Jan 28, 2010 at 10:33 AM, David Gobbi <david.gobbi at gmail.com> wrote:
>> I vote for:
>>
>> 4. vtkLocalPointer<vtkClass> instance;
>>
>>  - David
>>
>> On Thu, Jan 28, 2010 at 8:31 AM, Marcus D. Hanwell
>> <marcus.hanwell at kitware.com> wrote:
>>> On Thursday 28 January 2010 10:16:24 Jeff Baumes wrote:
>>>> On Thu, Jan 28, 2010 at 10:00 AM, Will Schroeder
>>>>
>>>> <will.schroeder at kitware.com> wrote:
>>>> > Jeff can you summarize the proposed solutions (assuming we think we've
>>>> > covered the bases) and let's take a vote on this. I want to keep my inbox
>>>> > clear :-(
>>>>
>>>> 1. Keep things the way they are:
>>>> vtkSmartPointer<vtkClass> c = vtkSmartPointer<vtkClass>::New();
>>>>
>>>> 2. Add new constructor to vtkSmartPointer that takes a bool and if
>>>> true creates an instance of the object. Code would look like:
>>>> vtkSmartPointer<vtkClass> c(true);
>>>>
>>>> 3. Create typedefs for vtkSmartPointer<vtkClass>:
>>>> vtkClassSP c = vtkClassSP::New();
>>>>
>>>> 4. Make a new vtkLocalPointer type that is the same as vtkSmartPointer
>>>> but always creates an instance of the object.
>>>> vtkLocalPointer<vtkClass> c;
>>>>
>>>> Unfortunately our inboxes won't be clear until everyone responds with
>>>> a vote (I'd maybe give it till 12pm eastern time). We can take it to
>>>> the ARB if there is no clear consensus.
>>>>
>>> My favorite is 4, then 2. I was thinking of reasonably concise API, I think 1
>>> has needless repetition and does not make the code any clearer.
>>>
>>> Marcus
>
>
> Wow, is the survey THAT bad of an idea? There are now 47 emails in the
> thread, completely unmanageable.
>
> Thanks,
>
> David
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtk-developers mailing list