mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-19 10:35:42 +00:00
fc9077e0c5
This resolves a compiler ambiguity I hit during development. In my case, I created an `ArrayHandleDecorator` with one of the arrays being an `ArrayHandleTransform`. The ambiguity occurs in function `DecoratorStorageTraits<...>::BuffersToArray`, here an `ArrayHandleTransform` is constructed using buffers (`std::vector<vtkm::cont::internal::Buffer>`) This constructor is not defined for `ArrayHandleTransform`, but it's defined for its superclass (`vtkm::cont::ArrayHandle`). `ArrayHandleTransform` does have a non-explicit constructor that takes the array to be transformed and the transform-functor as parameters, where the later has a default value. This produces the following ambiguous options for the compiler: 1. Create a "to-be-transformed" ArrayHandle instance using the buffers, call the `ArrayHandleTransform` constructor with this array with the defaulted functor parameter. 2. Create the superclass instance using the buffer and call the `ArrayHandleTransform` constructor that takes the superclass. In this situation, option 2 is the correct choice. The ambiguity is resolved by marking the constructors that take buffers as explicit. These constructors are also added for the derived classess via the `VTK_M_ARRAY_HANDLE_SUBCLASS_IMPL` macro. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
GenerateTestDataSets.h | ||
TestingContourTreeUniformDistributedLoadArrays.h | ||
UnitTestAverageByKey.cxx | ||
UnitTestBoundingIntervalHierarchy.cxx | ||
UnitTestCellDeepCopy.cxx | ||
UnitTestContourTreeUniformDistributed.cxx | ||
UnitTestCosmoTools.cxx | ||
UnitTestDescriptiveStatistics.cxx | ||
UnitTestDispatcherBase.cxx | ||
UnitTestFieldStatistics.cxx | ||
UnitTestKeys.cxx | ||
UnitTestMaskIndices.cxx | ||
UnitTestMaskSelect.cxx | ||
UnitTestNDimsHistMarginalization.cxx | ||
UnitTestNormalize.cxx | ||
UnitTestScalarsToColors.cxx | ||
UnitTestScatterAndMask.cxx | ||
UnitTestScatterAndMaskWithTopology.cxx | ||
UnitTestScatterCounting.cxx | ||
UnitTestScatterPermutation.cxx | ||
UnitTestSplatKernels.cxx | ||
UnitTestStreamLineUniformGrid.cxx | ||
UnitTestTriangleWinding.cxx | ||
UnitTestWaveletCompressor.cxx | ||
UnitTestWholeCellSetIn.cxx | ||
UnitTestWorkletMapField3d.cxx | ||
UnitTestWorkletMapField.cxx | ||
UnitTestWorkletMapFieldExecArg.cxx | ||
UnitTestWorkletMapFieldWholeArray.cxx | ||
UnitTestWorkletMapFieldWholeArrayAtomic.cxx | ||
UnitTestWorkletMapPointNeighborhood.cxx | ||
UnitTestWorkletMapTopologyExplicit.cxx | ||
UnitTestWorkletMapTopologyUniform.cxx | ||
UnitTestWorkletReduceByKey.cxx |