Skip to content

Draft: Support lambda functions in ArrayHandleImplicit

Kenneth Moreland requested to merge kmorel/vtk-m:lambdas-implicit-array into master

ArrayHandleImplicit now supports using a lambda function as its functor. Using lambdas, implicit arrays are easily constructed with make_ArrayHandleImplicit.

auto implicitArray = make_ArrayHandleImplicit(
  VTKM_LAMBDA(vtkm::Id index) { return /* value based on index */; }, size);

Previously, lambdas did not work with `ArrayHandleImplicit because the object created for a lambda function does not have a default constructor. The need for a default constructor has been eliminated.

Edited by Kenneth Moreland

Merge request reports