From 12810165bbd240e000b45bdd6a52b9310716efc4 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Mon, 29 Aug 2016 11:13:00 -0400 Subject: [PATCH] Switch over to c++11 type_traits. --- vtkm/CellShape.h | 14 ++-- vtkm/ListTag.h | 8 +- vtkm/TopologyElementTag.h | 31 +++---- vtkm/Types.h | 20 ++--- vtkm/VecTraits.h | 8 +- vtkm/cont/ArrayHandle.h | 50 ++++++----- vtkm/cont/ArrayHandleGroupVec.h | 6 +- vtkm/cont/CellSet.h | 13 +-- vtkm/cont/DynamicArrayHandle.h | 4 +- vtkm/cont/arg/ControlSignatureTagBase.h | 8 +- vtkm/cont/arg/TransportTagExecObject.h | 9 +- vtkm/cont/arg/TypeCheckTagExecObject.h | 8 +- vtkm/cont/internal/ArrayPortalFromIterators.h | 10 +-- .../internal/ConnectivityExplicitInternals.h | 4 +- .../internal/DeviceAdapterAlgorithmSerial.h | 5 -- vtkm/cont/internal/IteratorFromArrayPortal.h | 2 +- vtkm/cont/internal/PointCoordinatesBase.h | 13 +-- vtkm/cont/tbb/internal/FunctorsTBB.h | 29 ++++--- vtkm/cont/testing/TestingArrayHandles.h | 3 +- .../UnitTestDataSetBuilderRectilinear.cxx | 1 - .../testing/UnitTestDataSetBuilderUniform.cxx | 1 - vtkm/exec/arg/ExecutionSignatureTagBase.h | 6 +- vtkm/exec/arg/FetchTagExecObject.h | 8 +- .../cuda/internal/ArrayPortalFromThrust.h | 83 +++++++++---------- vtkm/exec/cuda/internal/WrappedOperators.h | 7 +- .../testing/UnitTestWorkletInvokeFunctor.cxx | 10 +-- vtkm/exec/testing/UnitTestCellDerivative.cxx | 1 - vtkm/internal/Configure.h.in | 7 -- vtkm/internal/ExportMacros.h | 9 ++ vtkm/internal/FunctionInterface.h | 18 ++-- .../testing/UnitTestFunctionInterface.cxx | 2 +- vtkm/io/reader/VTKDataSetReaderBase.h | 5 +- vtkm/testing/Testing.h | 4 +- vtkm/testing/VecTraitsTests.h | 8 +- vtkm/worklet/internal/DispatcherBase.h | 56 ++++++------- vtkm/worklet/splatkernels/Gaussian.h | 2 +- 36 files changed, 198 insertions(+), 275 deletions(-) diff --git a/vtkm/CellShape.h b/vtkm/CellShape.h index 65024c09a..ef8d84eeb 100644 --- a/vtkm/CellShape.h +++ b/vtkm/CellShape.h @@ -23,10 +23,6 @@ #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace vtkm { /// CellShapeId identifies the type of each cell. Currently these are designed @@ -63,10 +59,10 @@ enum CellShapeIdEnum namespace internal { /// A class that can be used to determine if a class is a CellShapeTag or not. -/// The class will be either boost::true_type or boost::false_type. +/// The class will be either std::true_type or std::false_type. /// template -struct CellShapeTagCheck : boost::false_type { }; +struct CellShapeTagCheck : std::false_type { }; } // namespace internal @@ -87,7 +83,7 @@ struct CellShapeIdToTag { // probably means you are using an ID that does not have a defined cell // shape. - typedef boost::false_type valid; + typedef std::false_type valid; }; @@ -100,7 +96,7 @@ struct CellShapeIdToTag { }; \ namespace internal { \ template<> \ - struct CellShapeTagCheck : boost::true_type { }; \ + struct CellShapeTagCheck : std::true_type { }; \ } \ VTKM_EXEC_CONT_EXPORT \ const char *GetCellShapeName(vtkm::CellShapeTag ## name) { \ @@ -108,7 +104,7 @@ struct CellShapeIdToTag { } \ template<> \ struct CellShapeIdToTag { \ - typedef boost::true_type valid; \ + typedef std::true_type valid; \ typedef vtkm::CellShapeTag ## name Tag; \ } diff --git a/vtkm/ListTag.h b/vtkm/ListTag.h index 853ce6406..71dd550b8 100644 --- a/vtkm/ListTag.h +++ b/vtkm/ListTag.h @@ -25,9 +25,7 @@ #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE +#include namespace vtkm { @@ -36,8 +34,8 @@ namespace internal { template struct ListTagCheck { - static const bool Valid = - boost::is_base_of::value; + static VTKM_CONSTEXPR bool Valid = std::is_base_of::value; }; } // namespace internal diff --git a/vtkm/TopologyElementTag.h b/vtkm/TopologyElementTag.h index bb4845733..1b392ed9d 100644 --- a/vtkm/TopologyElementTag.h +++ b/vtkm/TopologyElementTag.h @@ -22,10 +22,6 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace vtkm { /// \brief A tag used to identify the cell elements in a topology. @@ -63,44 +59,41 @@ struct TopologyElementTagFace { }; namespace internal { -/// Checks to see if the given object is a topology element tag. This check is -/// compatible with the Boost meta-template programing library (MPL). It -/// contains a typedef named \c type that is either boost::mpl::true_ or -/// boost::mpl::false_. Both of these have a typedef named value with the +/// Checks to see if the given object is a topology element tag.This check is +/// compatible with C++11 type_traits. +/// It contains a typedef named \c type that is either std::true_type or +/// std::false_type. Both of these have a typedef named value with the /// respective boolean value. /// template -struct TopologyElementTagCheck +struct TopologyElementTagCheck : std::false_type { - typedef boost::mpl::false_ type; }; template<> -struct TopologyElementTagCheck +struct TopologyElementTagCheck : std::true_type { - typedef boost::mpl::true_ type; }; template<> -struct TopologyElementTagCheck +struct TopologyElementTagCheck : std::true_type { - typedef boost::mpl::true_ type; }; template<> -struct TopologyElementTagCheck +struct TopologyElementTagCheck : std::true_type { - typedef boost::mpl::true_ type; }; template<> -struct TopologyElementTagCheck +struct TopologyElementTagCheck : std::true_type { - typedef boost::mpl::true_ type; }; + #define VTKM_IS_TOPOLOGY_ELEMENT_TAG(type) \ - BOOST_MPL_ASSERT(( ::vtkm::internal::TopologyElementTagCheck )) + static_assert( ::vtkm::internal::TopologyElementTagCheck::value, \ + "Invalid Topology Element Tag being used"); } // namespace internal diff --git a/vtkm/Types.h b/vtkm/Types.h index d7610f7b8..328c2db61 100644 --- a/vtkm/Types.h +++ b/vtkm/Types.h @@ -20,20 +20,13 @@ #ifndef vtk_m_Types_h #define vtk_m_Types_h - #include #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -#include -#include -#include -VTKM_THIRDPARTY_POST_INCLUDE - #include +#include /*! * \namespace vtkm @@ -1270,16 +1263,15 @@ operator/(const vtkm::Vec &vec, vtkm::Float64 scalar) } // The enable_if for this operator is effectively disabling the negate // operator for Vec of unsigned integers. Another approach would be -// to use disable_if. That would be more inclusive but would +// to use enable_if. That would be more inclusive but would // also allow other types like Vec >. If necessary, we could // change this implementation to be more inclusive. template VTKM_EXEC_CONT_EXPORT -typename boost::enable_if< - typename boost::mpl::or_< - typename boost::is_floating_point::type, - typename boost::is_signed::type>::type, - vtkm::Vec >::type +typename std::enable_if< + (std::is_floating_point::value || std::is_signed::value), + vtkm::Vec + >::type operator-(const vtkm::Vec &x) { return vtkm::internal::VecComponentWiseUnaryOperation()( diff --git a/vtkm/VecTraits.h b/vtkm/VecTraits.h index f3dd512d1..38f855044 100644 --- a/vtkm/VecTraits.h +++ b/vtkm/VecTraits.h @@ -22,10 +22,6 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace vtkm { /// A tag for vectors that are "true" vectors (i.e. have more than one @@ -103,10 +99,10 @@ struct VecTraits /// Returns the value in a given component of the vector. /// VTKM_EXEC_CONT_EXPORT static const ComponentType &GetComponent( - const typename boost::remove_const::type &vector, + const typename std::remove_const::type &vector, vtkm::IdComponent component); VTKM_EXEC_CONT_EXPORT static ComponentType &GetComponent( - typename boost::remove_const::type &vector, + typename std::remove_const::type &vector, vtkm::IdComponent component); /// Changes the value in a given component of the vector. diff --git a/vtkm/cont/ArrayHandle.h b/vtkm/cont/ArrayHandle.h index 86194c334..8f4657318 100644 --- a/vtkm/cont/ArrayHandle.h +++ b/vtkm/cont/ArrayHandle.h @@ -34,10 +34,8 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include -#include #include #include -#include VTKM_THIRDPARTY_POST_INCLUDE #include @@ -56,48 +54,48 @@ namespace internal { class ArrayHandleBase { }; /// Checks to see if the given type and storage can form a valid array handle -/// (some storage objects cannot support all types). This check is compatable -/// with the Boost meta-template programming library (MPL). It contains a -/// typedef named type that is either boost::mpl::true_ or boost::mpl::false_. +/// (some storage objects cannot support all types). This check is compatible +/// with C++11 type_traits. It contains a +/// typedef named type that is either std::true_type or std::false_type. /// Both of these have a typedef named value with the respective boolean value. /// template struct IsValidArrayHandle { - typedef typename boost::mpl::not_< - typename boost::is_base_of< - vtkm::cont::internal::UndefinedStorage, - vtkm::cont::internal::Storage - >::type - >::type type; + //need to add the not + using type = std::integral_constant + >::value)>; }; /// Checks to see if the ArrayHandle for the given DeviceAdatper allows /// writing, as some ArrayHandles (Implicit) don't support writing. -/// This check is compatable with the Boost meta-template programming -/// library (MPL). It contains a typedef named type that is either -// boost::mpl::true_ or boost::mpl::false_. +/// This check is compatible with the C++11 type_traits. +/// It contains a typedef named type that is either +/// std::true_type or std::false_type. /// Both of these have a typedef named value with the respective boolean value. /// template struct IsWriteableArrayHandle { private: - typedef typename ArrayHandle:: template ExecutionTypes< - DeviceAdapterTag > ExecutionTypes; - typedef typename ExecutionTypes::Portal::ValueType ValueType; + template + using ExecutionTypes = typename ArrayHandle::template ExecutionTypes; + + using ValueType = typename ExecutionTypes::Portal::ValueType; //All ArrayHandles that use ImplicitStorage as the final writable location //will have a value type of void*, which is what we are trying to detect - typedef typename boost::remove_pointer::type RawValueType; - typedef boost::is_void IsVoidType; + using RawValueType = typename std::remove_pointer::type; + using IsVoidType = std::is_void; public: - typedef typename boost::mpl::not_::type type; + using type = std::integral_constant; }; /// Checks to see if the given object is an array handle. This check is -/// compatible with the Boost meta-template programming library (MPL). It -/// contains a typedef named \c type that is either boost::mpl::true_ or -/// boost::mpl::false_. Both of these have a typedef named value with the -/// respective boolean value. +/// compatible with C++11 type_traits. It a typedef named \c type that is +/// either std::true_type or std::false_type. Both of these have a typedef +/// named value with the respective boolean value. /// /// Unlike \c IsValidArrayHandle, if an \c ArrayHandle is used with this /// class, then it must be created by the compiler and therefore must already @@ -109,8 +107,8 @@ public: template struct ArrayHandleCheck { - typedef typename boost::is_base_of< - ::vtkm::cont::internal::ArrayHandleBase, T>::type type; + using type = typename std::is_base_of< + ::vtkm::cont::internal::ArrayHandleBase, T>::type; }; #define VTKM_IS_ARRAY_HANDLE(T) \ diff --git a/vtkm/cont/ArrayHandleGroupVec.h b/vtkm/cont/ArrayHandleGroupVec.h index 3e8174f23..53edc4d72 100644 --- a/vtkm/cont/ArrayHandleGroupVec.h +++ b/vtkm/cont/ArrayHandleGroupVec.h @@ -24,10 +24,6 @@ #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace vtkm { namespace exec { @@ -41,7 +37,7 @@ public: typedef _SourcePortalType SourcePortalType; typedef typename - boost::remove_const::type + std::remove_const::type ComponentType; typedef vtkm::Vec ValueType; diff --git a/vtkm/cont/CellSet.h b/vtkm/cont/CellSet.h index b3eb09a01..433e9fcab 100644 --- a/vtkm/cont/CellSet.h +++ b/vtkm/cont/CellSet.h @@ -28,10 +28,6 @@ #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace vtkm { namespace cont { @@ -90,16 +86,15 @@ protected: namespace internal { -/// Checks to see if the given object is a cell set. This check is compatible -/// with the Boost meta-template programming library (MPL). It contains a -/// typedef named \c type that is either boost::mpl::true_ or -/// boost::mpl::false_. Both of these have a typedef named value with the +/// Checks to see if the given object is a cell set. It contains a +/// typedef named \c type that is either std::true_type or +/// std::false_type. Both of these have a typedef named value with the /// respective boolean value. /// template struct CellSetCheck { - typedef typename boost::is_base_of::type type; + using type = typename std::is_base_of; }; #define VTKM_IS_CELL_SET(T) \ diff --git a/vtkm/cont/DynamicArrayHandle.h b/vtkm/cont/DynamicArrayHandle.h index 4b16bf6d9..ff05185ae 100644 --- a/vtkm/cont/DynamicArrayHandle.h +++ b/vtkm/cont/DynamicArrayHandle.h @@ -442,7 +442,7 @@ struct DynamicArrayHandleTryStorage { private: template - void DoCast(Storage, boost::mpl::bool_) + void DoCast(Storage, std::true_type) { if (!this->FoundCast && this->Array->template IsTypeAndStorage()) @@ -453,7 +453,7 @@ private: } template - void DoCast(Storage, boost::mpl::bool_) + void DoCast(Storage, std::false_type) { // This type of array handle cannot exist, so do nothing. } diff --git a/vtkm/cont/arg/ControlSignatureTagBase.h b/vtkm/cont/arg/ControlSignatureTagBase.h index 66906cd25..bf87dedb7 100644 --- a/vtkm/cont/arg/ControlSignatureTagBase.h +++ b/vtkm/cont/arg/ControlSignatureTagBase.h @@ -23,9 +23,7 @@ #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE +#include namespace vtkm { namespace cont { @@ -49,8 +47,8 @@ namespace internal { template struct ControlSignatureTagCheck { - static const bool Valid = - boost::is_base_of< + static VTKM_CONSTEXPR bool Valid = + std::is_base_of< vtkm::cont::arg::ControlSignatureTagBase, ControlSignatureTag>::value; }; diff --git a/vtkm/cont/arg/TransportTagExecObject.h b/vtkm/cont/arg/TransportTagExecObject.h index f78008467..142632524 100644 --- a/vtkm/cont/arg/TransportTagExecObject.h +++ b/vtkm/cont/arg/TransportTagExecObject.h @@ -26,11 +26,6 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace vtkm { namespace cont { namespace arg { @@ -49,7 +44,9 @@ struct Transport // is not an execution object as an argument that is expected to be one. All // execution objects are expected to inherit from // vtkm::exec::ExecutionObjectBase. - BOOST_MPL_ASSERT(( boost::is_base_of )); + static_assert( + std::is_base_of::value, + "All execution objects are expected to inherit from vtkm::exec::ExecutionObjectBase"); typedef ContObjectType ExecObjectType; diff --git a/vtkm/cont/arg/TypeCheckTagExecObject.h b/vtkm/cont/arg/TypeCheckTagExecObject.h index 35dfdb7da..1d82e7849 100644 --- a/vtkm/cont/arg/TypeCheckTagExecObject.h +++ b/vtkm/cont/arg/TypeCheckTagExecObject.h @@ -26,9 +26,7 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE +#include namespace vtkm { namespace cont { @@ -43,8 +41,8 @@ struct TypeCheckTagExecObject { }; template struct TypeCheck { - static const bool value = - boost::is_base_of::value; + static VTKM_CONSTEXPR bool value = + std::is_base_of::value; }; } diff --git a/vtkm/cont/internal/ArrayPortalFromIterators.h b/vtkm/cont/internal/ArrayPortalFromIterators.h index c66620852..3cbd6d852 100755 --- a/vtkm/cont/internal/ArrayPortalFromIterators.h +++ b/vtkm/cont/internal/ArrayPortalFromIterators.h @@ -29,7 +29,7 @@ #include #include -#include +#include namespace vtkm { namespace cont { @@ -43,8 +43,8 @@ class ArrayPortalFromIterators; /// template class ArrayPortalFromIterators::type > >::type> + typename std::enable_if< + !std::is_const< typename std::remove_pointer::type >::value >::type > { public: typedef typename std::iterator_traits::value_type ValueType; @@ -127,8 +127,8 @@ private: template class ArrayPortalFromIterators::type > >::type> + typename std::enable_if< + std::is_const< typename std::remove_pointer::type >::value >::type > { public: typedef typename std::iterator_traits::value_type ValueType; diff --git a/vtkm/cont/internal/ConnectivityExplicitInternals.h b/vtkm/cont/internal/ConnectivityExplicitInternals.h index c9c09824b..1cf6b954e 100644 --- a/vtkm/cont/internal/ConnectivityExplicitInternals.h +++ b/vtkm/cont/internal/ConnectivityExplicitInternals.h @@ -35,7 +35,7 @@ template) + std::true_type) { //We first need to make sure that NumIndices and IndexOffsetArrayType //have the same type so we can call scane exclusive @@ -55,7 +55,7 @@ template) + std::false_type) { //this is a no-op as the storage for the offsets is an implicit handle //and should already be built. This signature exists so that diff --git a/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h b/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h index d44dcfa42..fc6540422 100644 --- a/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h +++ b/vtkm/cont/internal/DeviceAdapterAlgorithmSerial.h @@ -32,11 +32,6 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -#include -VTKM_THIRDPARTY_POST_INCLUDE - #include #include diff --git a/vtkm/cont/internal/IteratorFromArrayPortal.h b/vtkm/cont/internal/IteratorFromArrayPortal.h index b27d6f8ab..c4c5918f0 100644 --- a/vtkm/cont/internal/IteratorFromArrayPortal.h +++ b/vtkm/cont/internal/IteratorFromArrayPortal.h @@ -213,7 +213,7 @@ namespace boost { /// boost::is_reference type check to declare our value class as a reference /// type. Even though it is not a true reference type, its operators make it /// behave like one. -/// +/// template struct is_reference< vtkm::cont::internal::detail::IteratorFromArrayPortalValue > diff --git a/vtkm/cont/internal/PointCoordinatesBase.h b/vtkm/cont/internal/PointCoordinatesBase.h index 3c2e72b01..aafd787ef 100644 --- a/vtkm/cont/internal/PointCoordinatesBase.h +++ b/vtkm/cont/internal/PointCoordinatesBase.h @@ -23,10 +23,6 @@ #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - /// Checks that the argument is a proper \c PointCoordinates class. This is a /// handy concept check for functions and classes to make sure that a template /// argument is actually point coordinates. (You can get weird errors elsewhere @@ -61,15 +57,14 @@ public: virtual ~PointCoordinatesBase() { } }; -/// Checks to see if the given type is a valid point coordinates class. This -/// check is compatable with the Boost meta-template programming library (MPL). -/// It contains a typedef named type that is either boost::mpl::true_ or -/// boost::mpl::false_. Both of these have a typedef named value with the +/// Checks to see if the given type is a valid point coordinates class. +/// It contains a typedef named type that is either std::true_type or +/// std::false_type. Both of these have a typedef named value with the /// respective boolean value. /// template struct IsValidPointCoordinates { - typedef typename boost::is_base_of< + typedef typename std::is_base_of< vtkm::cont::internal::PointCoordinatesBase,Type>::type type; }; diff --git a/vtkm/cont/tbb/internal/FunctorsTBB.h b/vtkm/cont/tbb/internal/FunctorsTBB.h index 09914cdef..75ccc5cfa 100644 --- a/vtkm/cont/tbb/internal/FunctorsTBB.h +++ b/vtkm/cont/tbb/internal/FunctorsTBB.h @@ -29,8 +29,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE -#include - // gcc || clang #if defined(_WIN32) // TBB includes windows.h, which clobbers min and max functions so we @@ -77,8 +75,8 @@ template struct ScanInclusiveBody { - typedef typename boost::remove_reference< - typename OutputPortalType::ValueType>::type ValueType; + using ValueType = typename std::remove_reference< + typename OutputPortalType::ValueType>::type; ValueType Sum; bool FirstCall; InputPortalType InputPortal; @@ -175,8 +173,9 @@ template struct ScanExclusiveBody { - typedef typename boost::remove_reference< - typename OutputPortalType::ValueType>::type ValueType; + using ValueType = typename std::remove_reference< + typename OutputPortalType::ValueType>::type; + ValueType Sum; ValueType InitialValue; InputPortalType InputPortal; @@ -272,14 +271,14 @@ template VTKM_SUPPRESS_EXEC_WARNINGS VTKM_CONT_EXPORT static -typename boost::remove_reference::type +typename std::remove_reference::type ScanInclusivePortals(InputPortalType inputPortal, OutputPortalType outputPortal, BinaryOperationType binaryOperation) { - typedef typename - boost::remove_reference::type - ValueType; + using ValueType = typename std::remove_reference< + typename OutputPortalType::ValueType>::type; + typedef internal::WrappedBinaryOperator WrappedBinaryOp; @@ -297,16 +296,16 @@ template VTKM_SUPPRESS_EXEC_WARNINGS VTKM_CONT_EXPORT static -typename boost::remove_reference::type +typename std::remove_reference::type ScanExclusivePortals(InputPortalType inputPortal, OutputPortalType outputPortal, BinaryOperationType binaryOperation, - typename boost::remove_reference< + typename std::remove_reference< typename OutputPortalType::ValueType>::type initialValue) { - typedef typename - boost::remove_reference::type - ValueType; + using ValueType = typename std::remove_reference< + typename OutputPortalType::ValueType>::type; + typedef internal::WrappedBinaryOperator WrappedBinaryOp; diff --git a/vtkm/cont/testing/TestingArrayHandles.h b/vtkm/cont/testing/TestingArrayHandles.h index cf4ca25a8..5bd7c9554 100644 --- a/vtkm/cont/testing/TestingArrayHandles.h +++ b/vtkm/cont/testing/TestingArrayHandles.h @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -232,7 +231,7 @@ private: array_handle_testing::CheckValues(array, array+ARRAY_SIZE, T()); } - if (!boost::is_same::value) + if (!std::is_same::value) { std::cout << "Check using different device adapter" << std::endl; //Copy the data to the execution environment diff --git a/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx b/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx index f3b8e8a0d..d8b3f82c6 100644 --- a/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx +++ b/vtkm/cont/testing/UnitTestDataSetBuilderRectilinear.cxx @@ -30,7 +30,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include #include -#include VTKM_THIRDPARTY_POST_INCLUDE #include diff --git a/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx b/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx index 240969fcb..dec3cfcf5 100644 --- a/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx +++ b/vtkm/cont/testing/UnitTestDataSetBuilderUniform.cxx @@ -30,7 +30,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include #include -#include VTKM_THIRDPARTY_POST_INCLUDE #include diff --git a/vtkm/exec/arg/ExecutionSignatureTagBase.h b/vtkm/exec/arg/ExecutionSignatureTagBase.h index 18bb9ade9..0a0f04d60 100644 --- a/vtkm/exec/arg/ExecutionSignatureTagBase.h +++ b/vtkm/exec/arg/ExecutionSignatureTagBase.h @@ -23,9 +23,7 @@ #include #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE +#include namespace vtkm { namespace exec { @@ -51,7 +49,7 @@ template struct ExecutionSignatureTagCheck { static const bool Valid = - boost::is_base_of< + std::is_base_of< vtkm::exec::arg::ExecutionSignatureTagBase, ExecutionSignatureTag>:: value; }; diff --git a/vtkm/exec/arg/FetchTagExecObject.h b/vtkm/exec/arg/FetchTagExecObject.h index cc7296d7a..c59d40cc9 100644 --- a/vtkm/exec/arg/FetchTagExecObject.h +++ b/vtkm/exec/arg/FetchTagExecObject.h @@ -25,10 +25,7 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -#include -VTKM_THIRDPARTY_POST_INCLUDE +#include namespace vtkm { namespace exec { @@ -55,7 +52,8 @@ struct Fetch< // is not an execution object as an argument that is expected to be one. All // execution objects are expected to inherit from // vtkm::exec::ExecutionObjectBase. - BOOST_MPL_ASSERT(( boost::is_base_of )); + static_assert(std::is_base_of::value, + "All execution objects are expected to inherit from vtkm::exec::ExecutionObjectBase"); typedef ExecObjectType ValueType; diff --git a/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h b/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h index 3bafcd793..2389ad629 100644 --- a/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h +++ b/vtkm/exec/cuda/internal/ArrayPortalFromThrust.h @@ -24,12 +24,9 @@ #include #include +#include VTKM_THIRDPARTY_PRE_INCLUDE -#include -#include -#include - #include VTKM_THIRDPARTY_POST_INCLUDE @@ -38,30 +35,30 @@ namespace exec { namespace cuda { namespace internal { -template struct UseScalarTextureLoad {typedef boost::false_type type;}; -template struct UseVecTextureLoads {typedef boost::false_type type;}; -template struct UseMultipleScalarTextureLoads {typedef boost::false_type type;}; +template struct UseScalarTextureLoad : public std::false_type {}; +template struct UseVecTextureLoads : public std::false_type {}; +template struct UseMultipleScalarTextureLoads : public std::false_type {}; //currently CUDA doesn't support texture loading of signed char's so that is why //you don't see vtkm::Int8 in any of the lists. -template<> struct UseScalarTextureLoad< const vtkm::UInt8 > {typedef boost::true_type type; }; -template<> struct UseScalarTextureLoad< const vtkm::Int16 > {typedef boost::true_type type; }; -template<> struct UseScalarTextureLoad< const vtkm::UInt16 > {typedef boost::true_type type; }; -template<> struct UseScalarTextureLoad< const vtkm::Int32 > {typedef boost::true_type type; }; -template<> struct UseScalarTextureLoad< const vtkm::UInt32 > {typedef boost::true_type type; }; -template<> struct UseScalarTextureLoad< const vtkm::Float32 > {typedef boost::true_type type; }; -template<> struct UseScalarTextureLoad< const vtkm::Float64 > {typedef boost::true_type type; }; +template<> struct UseScalarTextureLoad< const vtkm::UInt8 > : std::true_type {}; +template<> struct UseScalarTextureLoad< const vtkm::Int16 > : std::true_type {}; +template<> struct UseScalarTextureLoad< const vtkm::UInt16 > : std::true_type {}; +template<> struct UseScalarTextureLoad< const vtkm::Int32 > : std::true_type {}; +template<> struct UseScalarTextureLoad< const vtkm::UInt32 > : std::true_type {}; +template<> struct UseScalarTextureLoad< const vtkm::Float32 > : std::true_type {}; +template<> struct UseScalarTextureLoad< const vtkm::Float64 > : std::true_type {}; //CUDA needs vec types converted to CUDA types ( float2, uint2), so we have a special //case for these vec texture loads. -template<> struct UseVecTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseVecTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseVecTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseVecTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; +template<> struct UseVecTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseVecTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseVecTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseVecTextureLoads< const vtkm::Vec > : std::true_type {}; -template<> struct UseVecTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseVecTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseVecTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; +template<> struct UseVecTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseVecTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseVecTextureLoads< const vtkm::Vec > : std::true_type {}; //CUDA doesn't support loading 3 wide values through a texture unit by default, @@ -69,26 +66,26 @@ template<> struct UseVecTextureLoads< const vtkm::Vec > {typede //currently CUDA doesn't support texture loading of signed char's so that is why //you don't see vtkm::Int8 in any of the lists. -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; -template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > {typedef boost::true_type type; }; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; +template<> struct UseMultipleScalarTextureLoads< const vtkm::Vec > : std::true_type {}; //this T type is not one that is valid to be loaded through texture memory @@ -108,7 +105,7 @@ struct load_through_texture // this T type is valid to be loaded through a single texture memory fetch template -struct load_through_texture::type >::type > +struct load_through_texture::value >::type > { static const vtkm::IdComponent WillUseTexture = 1; @@ -127,7 +124,7 @@ struct load_through_texture -struct load_through_texture::type >::type > +struct load_through_texture::value >::type > { static const vtkm::IdComponent WillUseTexture = 1; @@ -195,11 +192,11 @@ struct load_through_texture -struct load_through_texture::type >::type > +struct load_through_texture::value >::type > { static const vtkm::IdComponent WillUseTexture = 1; - typedef typename boost::remove_const::type NonConstT; + typedef typename std::remove_const::type NonConstT; __device__ static T get(const thrust::system::cuda::pointer& data) diff --git a/vtkm/exec/cuda/internal/WrappedOperators.h b/vtkm/exec/cuda/internal/WrappedOperators.h index 6ca67b73e..1163759aa 100644 --- a/vtkm/exec/cuda/internal/WrappedOperators.h +++ b/vtkm/exec/cuda/internal/WrappedOperators.h @@ -29,7 +29,6 @@ // Disable warnings we check vtkm for but Thrust does not. VTKM_THIRDPARTY_PRE_INCLUDE #include -#include VTKM_THIRDPARTY_POST_INCLUDE namespace vtkm { @@ -45,7 +44,7 @@ namespace internal { template struct WrappedUnaryPredicate { - typedef typename boost::remove_const::type T; + typedef typename std::remove_const::type T; //make typedefs that thust expects unary operators to have typedef T first_argument_type; @@ -88,7 +87,7 @@ struct WrappedUnaryPredicate template struct WrappedBinaryOperator { - typedef typename boost::remove_const::type T; + typedef typename std::remove_const::type T; //make typedefs that thust expects binary operators to have typedef T first_argument_type; @@ -163,7 +162,7 @@ struct WrappedBinaryOperator template struct WrappedBinaryPredicate { - typedef typename boost::remove_const::type T; + typedef typename std::remove_const::type T; //make typedefs that thust expects binary operators to have typedef T first_argument_type; diff --git a/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx b/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx index 2e7a6b7cf..c282d7ebb 100644 --- a/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx +++ b/vtkm/exec/internal/testing/UnitTestWorkletInvokeFunctor.cxx @@ -30,10 +30,6 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace { struct TestExecObject @@ -222,15 +218,15 @@ struct TestWorkletErrorProxy : vtkm::exec::FunctorBase // Check behavior of InvocationToFetch helper class. -VTKM_STATIC_ASSERT(( boost::is_same< +VTKM_STATIC_ASSERT(( std::is_same< vtkm::exec::internal::detail::InvocationToFetch::type, vtkm::exec::arg::Fetch >::type::value )); -VTKM_STATIC_ASSERT(( boost::is_same< +VTKM_STATIC_ASSERT(( std::is_same< vtkm::exec::internal::detail::InvocationToFetch::type, vtkm::exec::arg::Fetch >::type::value )); -VTKM_STATIC_ASSERT(( boost::is_same< +VTKM_STATIC_ASSERT(( std::is_same< vtkm::exec::internal::detail::InvocationToFetch::type, vtkm::exec::arg::Fetch >::type::value )); diff --git a/vtkm/exec/testing/UnitTestCellDerivative.cxx b/vtkm/exec/testing/UnitTestCellDerivative.cxx index 50c3f8d0c..63bcc257b 100644 --- a/vtkm/exec/testing/UnitTestCellDerivative.cxx +++ b/vtkm/exec/testing/UnitTestCellDerivative.cxx @@ -32,7 +32,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include #include -#include VTKM_THIRDPARTY_POST_INCLUDE #include diff --git a/vtkm/internal/Configure.h.in b/vtkm/internal/Configure.h.in index bff8bf646..1f19c54dc 100644 --- a/vtkm/internal/Configure.h.in +++ b/vtkm/internal/Configure.h.in @@ -134,8 +134,6 @@ _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") // GCC has a unused by set variable warnings that needs to be silenced. -// Because boost boost::shared_ptr inline assembly causes nvcc to incorrectly -// generate warnings. #if defined(VTKM_GCC) #define VTK_M_THIRDPARTY_GCC_WARNING_PRAGMAS \ _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") \ @@ -261,11 +259,6 @@ #cmakedefine VTKM_ENABLE_OPENGL_INTEROP #endif -// Determine whether we will use variadic templates (a new feature in C++11). -VTKM_THIRDPARTY_PRE_INCLUDE -# include -VTKM_THIRDPARTY_POST_INCLUDE - #if __cplusplus >= 201103L || ( defined(VTKM_MSVC) && _MSC_VER >= 1700 ) #define VTKM_HAVE_CXX_11 #endif diff --git a/vtkm/internal/ExportMacros.h b/vtkm/internal/ExportMacros.h index 2c95f2226..ccbf93e56 100644 --- a/vtkm/internal/ExportMacros.h +++ b/vtkm/internal/ExportMacros.h @@ -44,6 +44,15 @@ #define VTKM_CONT_EXPORT inline +// constexpr support was added to VisualStudio 2015 and above. So this makes +// sure when that we gracefully fall back to just const when using 2013 +#if defined(VTKM_MSVC) && _MSC_VER < 1900 +#define VTKM_CONSTEXPR const +#else +#define VTKM_CONSTEXPR constexpr +#endif + + /// Simple macro to identify a parameter as unused. This allows you to name a /// parameter that is not used. There are several instances where you might /// want to do this. For example, when using a parameter to overload or diff --git a/vtkm/internal/FunctionInterface.h b/vtkm/internal/FunctionInterface.h index ce8afc10d..e9fc126fe 100644 --- a/vtkm/internal/FunctionInterface.h +++ b/vtkm/internal/FunctionInterface.h @@ -31,7 +31,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include #include #include -#include #include #include #include @@ -41,7 +40,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include #include #include -#include VTKM_THIRDPARTY_POST_INCLUDE @@ -399,10 +397,12 @@ public: void Copy(const FunctionInterface &src) { this->Result = src.GetReturnValueSafe(); - typedef boost::static_unsigned_min< ARITY, - FunctionInterface::ARITY > MinArity; - (detail::CopyAllParameters()).Copy(this->Parameters, src.Parameters); + VTKM_CONSTEXPR vtkm::UInt16 minArity = + (ARITY < FunctionInterface::ARITY) ? + ARITY : FunctionInterface::ARITY; + + (detail::CopyAllParameters()).Copy(this->Parameters, src.Parameters); } void Copy(const FunctionInterface &src) @@ -812,12 +812,12 @@ public: typedef FunctionInterface< typename FuntionType::type > NextInterfaceType; //Determine if we should do the next transform, and if so convert from - //boost mpl to boost::true_type/false_type ( for readability of sigs) + //boost mpl to std::true_type/false_type ( for readability of sigs ) typedef typename boost::mpl::less< typename NextInterfaceType::SignatureArity, typename vtkm::internal::FunctionInterface::SignatureArity >::type IsLessType; - typedef boost::integral_constant ShouldDoNextTransformType; + typedef std::integral_constant ShouldDoNextTransformType; NextInterfaceType nextInterface = this->NewInterface.Append(newParameter); this->DoNextTransform(nextInterface, ShouldDoNextTransformType()); @@ -849,7 +849,7 @@ private: void DoNextTransform( vtkm::internal::FunctionInterface &nextInterface, - boost::true_type) const + std::true_type) const { typedef FunctionInterfaceDynamicTransformContContinue< OriginalFunction,NextFunction,TransformFunctor,FinishFunctor> NextContinueType; @@ -869,7 +869,7 @@ private: void DoNextTransform( vtkm::internal::FunctionInterface &nextInterface, - boost::false_type) const + std::false_type) const { this->Finish(nextInterface); } diff --git a/vtkm/internal/testing/UnitTestFunctionInterface.cxx b/vtkm/internal/testing/UnitTestFunctionInterface.cxx index a64113609..5804dbaef 100644 --- a/vtkm/internal/testing/UnitTestFunctionInterface.cxx +++ b/vtkm/internal/testing/UnitTestFunctionInterface.cxx @@ -75,7 +75,7 @@ struct GetReferenceFunctor { template struct ReturnType { - typedef const typename boost::remove_reference::type *type; + typedef const typename std::remove_reference::type *type; }; template diff --git a/vtkm/io/reader/VTKDataSetReaderBase.h b/vtkm/io/reader/VTKDataSetReaderBase.h index 5ac6fb0b9..44ebfbac6 100644 --- a/vtkm/io/reader/VTKDataSetReaderBase.h +++ b/vtkm/io/reader/VTKDataSetReaderBase.h @@ -36,7 +36,6 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include #include -#include VTKM_THIRDPARTY_POST_INCLUDE #include @@ -115,7 +114,7 @@ vtkm::cont::DynamicArrayHandle CreateDynamicArrayHandle(const std::vector &ve case 1: { typedef typename ClosestCommonType::Type CommonType; - if (!boost::is_same::value) + if (!std::is_same::value) { std::cerr << "Type " << vtkm::io::internal::DataTypeName::Name() << " is currently unsupported. Converting to " @@ -139,7 +138,7 @@ vtkm::cont::DynamicArrayHandle CreateDynamicArrayHandle(const std::vector &ve typedef typename vtkm::VecTraits::ComponentType InComponentType; typedef typename ClosestFloat::Type OutComponentType; typedef vtkm::Vec CommonType; - if (!boost::is_same::value) + if (!std::is_same::value) { std::cerr << "Type " << vtkm::io::internal::DataTypeName::Name() << "[" << vtkm::VecTraits::NUM_COMPONENTS << "] " diff --git a/vtkm/testing/Testing.h b/vtkm/testing/Testing.h index 037fb6270..832bb1684 100644 --- a/vtkm/testing/Testing.h +++ b/vtkm/testing/Testing.h @@ -135,7 +135,7 @@ struct InternalTryCellShape private: template - void PrintAndInvoke(const FunctionType &function, boost::true_type) const { + void PrintAndInvoke(const FunctionType &function, std::true_type) const { typedef typename vtkm::CellShapeIdToTag::Tag CellShapeTag; std::cout << "*** " << vtkm::GetCellShapeName(CellShapeTag()) @@ -144,7 +144,7 @@ private: } template - void PrintAndInvoke(const FunctionType &, boost::false_type) const { + void PrintAndInvoke(const FunctionType &, std::false_type) const { // Not a valid cell shape. Do nothing. } }; diff --git a/vtkm/testing/VecTraitsTests.h b/vtkm/testing/VecTraitsTests.h index a353bd813..8dce015be 100644 --- a/vtkm/testing/VecTraitsTests.h +++ b/vtkm/testing/VecTraitsTests.h @@ -26,10 +26,6 @@ #include -VTKM_THIRDPARTY_PRE_INCLUDE -#include -VTKM_THIRDPARTY_POST_INCLUDE - namespace vtkm { namespace testing { @@ -63,11 +59,11 @@ inline void CheckIsStatic(const T &, vtkm::VecTraitsTagSizeVariable) /// the Tuple class. template static void TestVecTypeImpl( - const typename boost::remove_const::type &vector) + const typename std::remove_const::type &vector) { typedef typename vtkm::VecTraits Traits; typedef typename Traits::ComponentType ComponentType; - typedef typename boost::remove_const::type NonConstT; + typedef typename std::remove_const::type NonConstT; CheckIsStatic(vector, typename Traits::IsSizeStatic()); diff --git a/vtkm/worklet/internal/DispatcherBase.h b/vtkm/worklet/internal/DispatcherBase.h index 503adeabd..7b7e3d488 100644 --- a/vtkm/worklet/internal/DispatcherBase.h +++ b/vtkm/worklet/internal/DispatcherBase.h @@ -40,13 +40,10 @@ VTKM_THIRDPARTY_PRE_INCLUDE #include -#include #include #include #include #include -#include -#include VTKM_THIRDPARTY_POST_INCLUDE #include @@ -65,8 +62,8 @@ namespace detail { // these unsupported combinations we just silently halt the compiler from // attempting to create code for these errant conditions and throw a run-time // error if one every tries to create one. -inline void PrintFailureMessage(int, boost::true_type) {} -inline void PrintFailureMessage(int index, boost::false_type) +inline void PrintFailureMessage(int, std::true_type) {} +inline void PrintFailureMessage(int index, std::false_type) { std::stringstream message; message << "Encountered bad type for parameter " @@ -82,11 +79,12 @@ struct DetermineIfHasDynamicParameter struct apply { typedef typename vtkm::cont::internal::DynamicTransformTraits::DynamicTag DynamicTag; - typedef typename boost::is_same< + typedef typename std::is_same< DynamicTag, vtkm::cont::internal::DynamicTransformTagCastAndCall>::type UType; - typedef typename boost::mpl::or_::type type; + typedef std::integral_constant type; }; }; @@ -99,10 +97,10 @@ void NiceInCorrectParameterErrorMessage() } template -void ShowInCorrectParameter(boost::mpl::true_, T) {} +void ShowInCorrectParameter(std::true_type, T) {} template -void ShowInCorrectParameter(boost::mpl::false_, T) +void ShowInCorrectParameter(std::false_type, T) { typedef typename boost::mpl::deref::type ZipType; typedef typename boost::mpl::at_c::type ValueType; @@ -118,19 +116,15 @@ struct DetermineHasInCorrectParameters template struct apply { - typedef typename boost::mpl::at_c::type ValueType; - typedef typename boost::mpl::at_c::type ControlSignatureTag; - - typedef typename ControlSignatureTag::TypeCheckTag TypeCheckTag; - - typedef boost::mpl::bool_< - vtkm::cont::arg::TypeCheck::value> CanContinueTagType; + using ValueType = typename boost::mpl::at_c::type; + using ControlSignatureTag = typename boost::mpl::at_c::type; + using TypeCheckTag = typename ControlSignatureTag::TypeCheckTag; //We need to not the result of CanContinueTagType, because we want to return //true when we have the first parameter that DOES NOT match the control //signature requirements - typedef typename boost::mpl::not_< typename CanContinueTagType::type - >::type type; + using type = std::integral_constant< bool, + !vtkm::cont::arg::TypeCheck::value>; }; }; @@ -177,7 +171,7 @@ struct DispatcherBaseTypeCheckFunctor VTKM_CONT_EXPORT void operator()(const T &x) const { - typedef boost::integral_constant::value> CanContinueTagType; vtkm::worklet::internal::detail::PrintFailureMessage(Index,CanContinueTagType()); @@ -187,14 +181,14 @@ struct DispatcherBaseTypeCheckFunctor private: template VTKM_CONT_EXPORT - void WillContinue(const T &x, boost::true_type) const + void WillContinue(const T &x, std::true_type) const { this->Continue(x); } template VTKM_CONT_EXPORT - void WillContinue(const T&, boost::false_type) const + void WillContinue(const T&, std::false_type) const { } }; @@ -239,7 +233,7 @@ struct DispatcherBaseDynamicTransformHelper template VTKM_CONT_EXPORT void operator()(const FunctionInterface ¶meters) const { - this->Dispatcher->DynamicTransformInvoke(parameters, boost::mpl::true_() ); + this->Dispatcher->DynamicTransformInvoke(parameters, std::true_type() ); } }; @@ -334,10 +328,12 @@ private: const vtkm::internal::FunctionInterface ¶meters) const { typedef vtkm::internal::FunctionInterface ParameterInterface; + VTKM_STATIC_ASSERT_MSG(ParameterInterface::ARITY == NUM_INVOKE_PARAMS, "Dispatcher Invoke called with wrong number of arguments."); - BOOST_MPL_ASSERT(( boost::is_base_of )); + static_assert( std::is_base_of::value, + "The worklet being scheduled by this dispatcher doesn't match the type of the dispatcher"); //We need to determine if we have the need to do any dynamic //transforms. This is fairly simple of a query. We just need to check @@ -348,7 +344,7 @@ private: typedef boost::function_types::parameter_types MPLSignatureForm; typedef typename boost::mpl::fold< MPLSignatureForm, - boost::mpl::false_, + std::false_type, detail::DetermineIfHasDynamicParameter>::type HasDynamicTypes; this->StartInvokeDynamic(parameters, HasDynamicTypes() ); @@ -359,7 +355,7 @@ private: VTKM_CONT_EXPORT void StartInvokeDynamic( const vtkm::internal::FunctionInterface ¶meters, - boost::mpl::true_) const + std::true_type) const { // As we do the dynamic transform, we are also going to check the static // type against the TypeCheckTag in the ControlSignature tags. To do this, @@ -379,7 +375,7 @@ private: VTKM_CONT_EXPORT void StartInvokeDynamic( const vtkm::internal::FunctionInterface ¶meters, - boost::mpl::false_) const + std::false_type) const { //Nothing requires a conversion from dynamic to static types, so //next we need to verify that each argument's type is correct. If not @@ -395,8 +391,8 @@ private: ZippedView, detail::DetermineHasInCorrectParameters>::type LocationOfIncorrectParameter; - typedef typename boost::is_same< LocationOfIncorrectParameter, - typename boost::mpl::end< ZippedView>::type >::type HasOnlyCorrectTypes; + typedef typename std::is_same< LocationOfIncorrectParameter, + typename boost::mpl::end< ZippedView>::type >::type HasOnlyCorrectTypes; //When HasOnlyCorrectTypes is false we produce an error //message which should state what the parameter type and tag type is @@ -411,7 +407,7 @@ private: VTKM_CONT_EXPORT void DynamicTransformInvoke( const vtkm::internal::FunctionInterface ¶meters, - boost::mpl::true_ ) const + std::true_type ) const { // TODO: Check parameters static const vtkm::IdComponent INPUT_DOMAIN_INDEX = @@ -425,7 +421,7 @@ private: VTKM_CONT_EXPORT void DynamicTransformInvoke( const vtkm::internal::FunctionInterface &, - boost::mpl::false_ ) const + std::false_type ) const { } diff --git a/vtkm/worklet/splatkernels/Gaussian.h b/vtkm/worklet/splatkernels/Gaussian.h index 6db6fb1d9..392f46976 100644 --- a/vtkm/worklet/splatkernels/Gaussian.h +++ b/vtkm/worklet/splatkernels/Gaussian.h @@ -54,7 +54,7 @@ struct Gaussian : public KernelBase< Gaussian > //--------------------------------------------------------------------- // return the multiplier between smoothing length and max cutoff distance - /*constexpr */ double getDilationFactor() const { return 5.0; } + VTKM_CONSTEXPR double getDilationFactor() const { return 5.0; } //--------------------------------------------------------------------- // compute w(h) for the given distance