mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +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. |
||
---|---|---|
.. | ||
cont | ||
exec | ||
filter | ||
internal | ||
interop | ||
io | ||
random | ||
rendering | ||
source | ||
testing | ||
thirdparty | ||
worklet | ||
.gitattributes | ||
Assert.h | ||
Atomic.h | ||
BinaryOperators.h | ||
BinaryPredicates.h | ||
Bitset.h | ||
Bounds.h | ||
CellClassification.h | ||
CellShape.h | ||
CellTraits.h | ||
CMakeLists.txt | ||
Deprecated.h | ||
ErrorCode.h | ||
Flags.h | ||
Geometry.h | ||
Geometry.hxx | ||
Hash.h | ||
ImplicitFunction.h | ||
List.h | ||
LowerBound.h | ||
Math.h | ||
Math.h.in | ||
Matrix.h | ||
NewtonsMethod.h | ||
Pair.h | ||
Particle.h | ||
Range.h | ||
RangeId2.h | ||
RangeId3.h | ||
RangeId.h | ||
StaticAssert.h | ||
Swap.h | ||
TopologyElementTag.h | ||
Transform3D.h | ||
Tuple.h | ||
Tuple.h.in | ||
TypeList.h | ||
Types.h | ||
TypeTraits.h | ||
UnaryPredicates.h | ||
UpperBound.h | ||
VecAxisAlignedPointCoordinates.h | ||
VecFlat.h | ||
VecFromPortal.h | ||
VecFromPortalPermute.h | ||
VectorAnalysis.h | ||
VecTraits.h | ||
VecVariable.h | ||
Version.h.in | ||
vtkm.module |