Add implicit raw pointer conversion to vtkNew
Added implicit conversion of vtkNew object to the raw pointer that it holds: 1. to make smart pointers more convenient to use, and 2. be consistent with vtkSmartPointer. In practice, it means that there is no more need for calling GetPointer() to get a raw pointer from a vtkNew<> object. For example: vtkNew<vtkImageData> img; someFilter->SetInputData(img); // previously img.GetPointer() was required instead of just img Rationale: VTK's intrusive reference count allows raw pointers to hold references. This is the main distinction from std::shared_ptr that makes implicit conversion to a raw pointer safer. For reference, this conversion was added to vtkSmartPointer by commit 69a91050, aka commit v5.0.0~3861 (Added implicit conversion to contained pointer, 2004-04-19).
Loading
Please register or sign in to comment