[vtk-developers] vtkNew<>

Bill Lorensen bill.lorensen at gmail.com
Thu Jan 28 18:32:13 EST 2010


I love it. Can we try it? I'll convert some tests I've been modernizing...

Bill

On Thu, Jan 28, 2010 at 5:05 PM, Brad King <brad.king at kitware.com> wrote:
> Bill Lorensen wrote:
>> I admit I don't understand the "how", but the "what" looks great.
>>
>> So,
>> instead of:
>>
>> vtkSmartPointer<vtkImageRectilinearWipe> wipe =
>>   vtkSmartPointer<vtkImageRectilinearWipe>::New();
>>
>> it would be what?
>> vtkNew<vtkImageRectilinearWipe> wipe;
>
> Correct:
>
>  vtkNew<vtkImageRectilinearWipe> wipe;
>
> It resembles the Tcl wrapper syntax:
>
>  vtkImageRectilinearWipe wipe
>
> The "base = new derived" case is not quite as nice but it doesn't
> have any repetition:
>
>  vtkSmartPointer<vtkObject> base = vtkNew<vtkImageRectilinearWipe>();
>
> -Brad
>



More information about the vtk-developers mailing list