diff --git a/contrib/IECoreUSD/src/IECoreUSD/SceneCacheData.h b/contrib/IECoreUSD/src/IECoreUSD/SceneCacheData.h index 632d5d0d98..4c991dae46 100644 --- a/contrib/IECoreUSD/src/IECoreUSD/SceneCacheData.h +++ b/contrib/IECoreUSD/src/IECoreUSD/SceneCacheData.h @@ -54,8 +54,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "pxr/usd/sdf/path.h" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/shared_ptr.hpp" - #include // plugins to USD are required to use the internal pxr namespace @@ -93,7 +91,7 @@ class SceneCacheData : public SdfAbstractData std::vector List(const SdfPath& path) const override; std::set ListAllTimeSamples() const override; - + std::set ListTimeSamplesForPath(const SdfPath& path) const override; bool GetBracketingTimeSamples(double time, double* tLower, double* tUpper) const override; @@ -158,7 +156,7 @@ class SceneCacheData : public SdfAbstractData typedef std::pair FieldValuePair; struct SpecData { SpecData() : specType(SdfSpecTypeUnknown) {} - + SdfSpecType specType; std::vector fields; }; diff --git a/include/IECore/BoxTraits.h b/include/IECore/BoxTraits.h index a1653bd7f5..a44cf0cd1d 100644 --- a/include/IECore/BoxTraits.h +++ b/include/IECore/BoxTraits.h @@ -44,8 +44,6 @@ IECORE_POP_DEFAULT_VISIBILITY #include "Imath/ImathBoxAlgo.h" -#include "boost/static_assert.hpp" - #include namespace IECore diff --git a/include/IECore/ByteOrder.h b/include/IECore/ByteOrder.h index e2972f5cf2..858a8a28c5 100644 --- a/include/IECore/ByteOrder.h +++ b/include/IECore/ByteOrder.h @@ -35,8 +35,6 @@ #ifndef IE_CORE_BYTEORDER_H #define IE_CORE_BYTEORDER_H -#include "boost/static_assert.hpp" - #include namespace IECore @@ -74,8 +72,7 @@ inline bool bigEndian() template inline T reverseBytes( const T &x ) { - // needs specialising for each type - BOOST_STATIC_ASSERT(sizeof(T)==0); + static_assert( sizeof( T ) == 0, "reverseBytes requires specialisation" ); } template<> @@ -125,7 +122,7 @@ inline uint32_t reverseBytes( const uint32_t &x ) template<> inline float reverseBytes( const float &x ) { - BOOST_STATIC_ASSERT( sizeof(uint32_t) == sizeof(float) ); + static_assert( sizeof( uint32_t ) == sizeof( float) ); union { uint32_t i; float f; @@ -151,7 +148,7 @@ inline uint64_t reverseBytes( const uint64_t &x ) template<> inline double reverseBytes( const double &x ) { - BOOST_STATIC_ASSERT( sizeof(uint64_t) == sizeof(double) ); + static_assert( sizeof( uint64_t ) == sizeof( double ) ); union { uint64_t i; double d; diff --git a/include/IECore/CachedReader.h b/include/IECore/CachedReader.h index 57f170597e..6bb8995998 100644 --- a/include/IECore/CachedReader.h +++ b/include/IECore/CachedReader.h @@ -40,7 +40,7 @@ #include "IECore/ObjectPool.h" #include "IECore/SearchPath.h" -#include "boost/shared_ptr.hpp" +#include namespace IECore { @@ -81,6 +81,8 @@ class IECORE_API CachedReader : public RefCounted /// objects following loading. Will use the given ObjectPool to store the loaded objects. CachedReader( const SearchPath &paths, ConstModifyOpPtr postProcessor, ObjectPoolPtr objectPool = ObjectPool::defaultObjectPool() ); + ~CachedReader() override; + /// Searches for the given file and loads it if found. /// Throws an exception in case it cannot be found or no suitable Reader /// exists. The Object is returned with only const access as @@ -122,7 +124,7 @@ class IECORE_API CachedReader : public RefCounted private : struct MemberData; - boost::shared_ptr m_data; + std::unique_ptr m_data; }; diff --git a/include/IECore/CompoundDataConversion.h b/include/IECore/CompoundDataConversion.h index da4e2a13d9..df8a52e009 100644 --- a/include/IECore/CompoundDataConversion.h +++ b/include/IECore/CompoundDataConversion.h @@ -37,7 +37,6 @@ #include "IECore/DataConversion.h" -#include "boost/static_assert.hpp" #include "boost/type_traits.hpp" namespace IECore @@ -50,7 +49,7 @@ class CompoundDataConversion : public DataConversion< typename C1::FromType, typ { public: /// These two types must be the same, so that the function composition works - BOOST_STATIC_ASSERT( (boost::is_same< typename C1::ToType, typename C2::FromType >::value) ); + static_assert( std::is_same_v ); /// Inverse defined by the equality: (f o g)'(x) = ( g' o f' )(x) typedef CompoundDataConversion< typename C2::InverseType, typename C1::InverseType > InverseType; diff --git a/include/IECore/DataConversion.h b/include/IECore/DataConversion.h index 80294ab71b..141c61abab 100644 --- a/include/IECore/DataConversion.h +++ b/include/IECore/DataConversion.h @@ -35,7 +35,6 @@ #ifndef IE_CORE_DATACONVERSION_H #define IE_CORE_DATACONVERSION_H -#include "boost/static_assert.hpp" #include "boost/type_traits/integral_constant.hpp" namespace IECore @@ -61,13 +60,13 @@ struct DataConversion T operator()( F f ) const { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); + static_assert( sizeof( T ) == 0 ); } InverseType inverse() const { /// Function is not invertible - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); + static_assert( sizeof( T ) == 0 ); } }; diff --git a/include/IECore/DataPromoteOp.h b/include/IECore/DataPromoteOp.h index 61e936c910..78a2f88f94 100644 --- a/include/IECore/DataPromoteOp.h +++ b/include/IECore/DataPromoteOp.h @@ -40,8 +40,6 @@ #include "IECore/ObjectParameter.h" #include "IECore/Op.h" -#include "boost/static_assert.hpp" - namespace IECore { @@ -73,7 +71,7 @@ class IECORE_API DataPromoteOp : public Op template struct Promote2Fn { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); + static_assert( sizeof( T ) == 0 ); }; ObjectParameterPtr m_objectParameter; diff --git a/include/IECore/DespatchTypedData.inl b/include/IECore/DespatchTypedData.inl index 8ffb1c909a..19c6a95026 100644 --- a/include/IECore/DespatchTypedData.inl +++ b/include/IECore/DespatchTypedData.inl @@ -442,7 +442,7 @@ struct TypedDataSize { ReturnType operator()( const T *data ) const { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); + static_assert( sizeof( T ) == 0 ); return 0; } }; @@ -485,7 +485,7 @@ struct TypedDataAddress { ReturnType operator()( const T *data ) const { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); + static_assert( sizeof( T ) == 0 ); return nullptr; } }; diff --git a/include/IECore/DimensionTraits.h b/include/IECore/DimensionTraits.h index ec8654e606..70bc60f084 100644 --- a/include/IECore/DimensionTraits.h +++ b/include/IECore/DimensionTraits.h @@ -48,7 +48,7 @@ namespace IECore template< int N, typename T = void > struct DimensionTraits { - BOOST_STATIC_ASSERT( sizeof( T ) == 0 ); + static_assert( sizeof( T ) == 0 ); typedef void VectorType; typedef void BoxType; diff --git a/include/IECore/DimensionTraits.inl b/include/IECore/DimensionTraits.inl index f4622a8005..42898f8749 100644 --- a/include/IECore/DimensionTraits.inl +++ b/include/IECore/DimensionTraits.inl @@ -45,8 +45,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "Imath/ImathVec.h" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/static_assert.hpp" - namespace IECore { @@ -54,7 +52,7 @@ namespace IECore template struct DimensionTraits<1, T> { - BOOST_STATIC_ASSERT( boost::is_arithmetic::value ); + static_assert( boost::is_arithmetic::value ); typedef T ValueType; typedef T VectorType; typedef void BoxType; @@ -66,7 +64,7 @@ struct DimensionTraits<1, T> template struct DimensionTraits<2, T> { - BOOST_STATIC_ASSERT( boost::is_arithmetic::value ); + static_assert( boost::is_arithmetic::value ); typedef T ValueType; typedef Imath::Vec2 VectorType; typedef Imath::Box< VectorType > BoxType; @@ -78,7 +76,7 @@ struct DimensionTraits<2, T> template struct DimensionTraits<3, T> { - BOOST_STATIC_ASSERT( boost::is_arithmetic::value ); + static_assert( boost::is_arithmetic::value ); typedef T ValueType; typedef Imath::Vec3 VectorType; typedef Imath::Box< VectorType > BoxType; diff --git a/include/IECore/EuclideanToSphericalTransform.h b/include/IECore/EuclideanToSphericalTransform.h index 25ccf9bf9f..a71f847c73 100644 --- a/include/IECore/EuclideanToSphericalTransform.h +++ b/include/IECore/EuclideanToSphericalTransform.h @@ -38,8 +38,6 @@ #include "IECore/SpaceTransform.h" #include "IECore/TypeTraits.h" -#include "boost/static_assert.hpp" - namespace IECore { @@ -54,8 +52,8 @@ template class EuclideanToSphericalTransform : public SpaceTransform< F, T > { public: - BOOST_STATIC_ASSERT( ( TypeTraits::IsVec3::value ) ); - BOOST_STATIC_ASSERT( ( boost::mpl::or_< TypeTraits::IsVec3, TypeTraits::IsVec2 >::value == true ) ); + static_assert( ( TypeTraits::IsVec3::value ) ); + static_assert( ( boost::mpl::or_< TypeTraits::IsVec3, TypeTraits::IsVec2 >::value == true ) ); typedef EuclideanToSphericalTransform< T, F > InverseType; diff --git a/include/IECore/HexConversion.h b/include/IECore/HexConversion.h index 2148c6e43b..aa52181faf 100644 --- a/include/IECore/HexConversion.h +++ b/include/IECore/HexConversion.h @@ -38,7 +38,6 @@ #ifndef IE_CORE_HEXCONVERSION_H #define IE_CORE_HEXCONVERSION_H -#include "boost/static_assert.hpp" #include "boost/type_traits/is_integral.hpp" #include "boost/type_traits/is_same.hpp" @@ -52,9 +51,9 @@ namespace IECore template inline void decToHex( T value, OutputIterator result ) { - BOOST_STATIC_ASSERT( boost::is_integral::value ); + static_assert( boost::is_integral::value ); typedef typename std::iterator_traits::value_type CharType; - BOOST_STATIC_ASSERT( ( boost::is_same::value ) ); + static_assert( ( boost::is_same::value ) ); for( int i = sizeof( T ) * 2 - 1; i >= 0 ; --i ) { @@ -86,7 +85,7 @@ inline std::string decToHex( RandomAccessIterator first, RandomAccessIterator la template inline std::string decToHex( T n ) { - BOOST_STATIC_ASSERT( boost::is_integral::value ); + static_assert( boost::is_integral::value ); std::string r; r.resize( sizeof( T ) * 2 ); decToHex( n, r.begin() ); @@ -97,9 +96,9 @@ inline std::string decToHex( T n ) template inline T hexToDec( InputIterator first, InputIterator last ) { - BOOST_STATIC_ASSERT( boost::is_integral::value ); + static_assert( boost::is_integral::value ); typedef typename std::iterator_traits::value_type CharType; - BOOST_STATIC_ASSERT( ( boost::is_same::value ) ); + static_assert( ( boost::is_same::value ) ); T n = 0; @@ -182,7 +181,7 @@ template inline void hexToDec( InputIterator first, InputIterator last, OutputIterator result ) { typedef typename std::iterator_traits::value_type CharType; - BOOST_STATIC_ASSERT( ( boost::is_same::value ) ); + static_assert( ( boost::is_same::value ) ); for( ; first != last; first += sizeof( T ) * 2 ) { diff --git a/include/IECore/IndexedIO.inl b/include/IECore/IndexedIO.inl index 29991f2a2d..5f6dfe22f9 100644 --- a/include/IECore/IndexedIO.inl +++ b/include/IECore/IndexedIO.inl @@ -34,8 +34,6 @@ #include "OpenEXR/ImfXdr.h" -#include "boost/static_assert.hpp" - #include #include diff --git a/include/IECore/LevenbergMarquardt.h b/include/IECore/LevenbergMarquardt.h index 0c11d1bcfc..fcc7739c19 100644 --- a/include/IECore/LevenbergMarquardt.h +++ b/include/IECore/LevenbergMarquardt.h @@ -39,8 +39,6 @@ #include "IECore/TypeTraits.h" #include "IECore/VectorTypedData.h" -#include "boost/static_assert.hpp" - namespace IECore { @@ -54,7 +52,7 @@ struct DefaultLevenbergMarquardtTraits; /// template /// class DefaultErrorFn /// { -/// BOOST_STATIC_ASSERT( boost::is_floating_point::value ); +/// static_assert( boost::is_floating_point::value ); /// /// public : /// @@ -87,7 +85,7 @@ struct DefaultLevenbergMarquardtTraits; template class Traits = DefaultLevenbergMarquardtTraits > class LevenbergMarquardt : public boost::noncopyable { - BOOST_STATIC_ASSERT( boost::is_floating_point::value ); + static_assert( boost::is_floating_point::value ); public: diff --git a/include/IECore/MeanSquaredError.h b/include/IECore/MeanSquaredError.h index ff110fb045..094491bd96 100644 --- a/include/IECore/MeanSquaredError.h +++ b/include/IECore/MeanSquaredError.h @@ -35,8 +35,6 @@ #ifndef IE_CORE_MEANSQUAREDERROR_H #define IE_CORE_MEANSQUAREDERROR_H -#include "boost/static_assert.hpp" - namespace IECore { @@ -47,7 +45,7 @@ struct MeanSquaredError { ReturnType operator()( const T &a, const T &b ) const { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); + static_assert( sizeof(T) == 0 ); return ReturnType(0); } }; diff --git a/include/IECore/ObjectPool.h b/include/IECore/ObjectPool.h index f82a17cca5..20287c063c 100644 --- a/include/IECore/ObjectPool.h +++ b/include/IECore/ObjectPool.h @@ -39,7 +39,7 @@ #include "IECore/MurmurHash.h" #include "IECore/Object.h" -#include "boost/shared_ptr.hpp" +#include namespace IECore { @@ -113,7 +113,7 @@ class IECORE_API ObjectPool : public RefCounted private: struct MemberData; - boost::shared_ptr m_data; + std::unique_ptr m_data; }; } // namespace IECore diff --git a/include/IECore/RadixSort.h b/include/IECore/RadixSort.h index 0a9e9fc822..45ce4cb628 100644 --- a/include/IECore/RadixSort.h +++ b/include/IECore/RadixSort.h @@ -38,8 +38,6 @@ #include "IECore/Export.h" #include "IECore/VectorTypedData.h" -#include "boost/static_assert.hpp" - #include namespace IECore @@ -53,9 +51,9 @@ class IECORE_API RadixSort { public: - BOOST_STATIC_ASSERT( sizeof( int ) == 4 ); - BOOST_STATIC_ASSERT( sizeof( unsigned int ) == 4 ); - BOOST_STATIC_ASSERT( sizeof( float ) == 4 ); + static_assert( sizeof( int ) == 4 ); + static_assert( sizeof( unsigned int ) == 4 ); + static_assert( sizeof( float ) == 4 ); RadixSort(); virtual ~RadixSort(); diff --git a/include/IECore/ScaledDataConversion.h b/include/IECore/ScaledDataConversion.h index 08fbe72b4d..862b4c3dd3 100644 --- a/include/IECore/ScaledDataConversion.h +++ b/include/IECore/ScaledDataConversion.h @@ -37,8 +37,6 @@ #include "IECore/DataConversion.h" -#include "boost/static_assert.hpp" - namespace IECore { @@ -56,7 +54,7 @@ struct ScaledDataConversion : public DataConversion< F, T > { T operator()( F f ) const { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); + static_assert( sizeof(T) == 0 ); } }; diff --git a/include/IECore/ScaledDataConversion.inl b/include/IECore/ScaledDataConversion.inl index d7b4ec18ed..bde09aee20 100644 --- a/include/IECore/ScaledDataConversion.inl +++ b/include/IECore/ScaledDataConversion.inl @@ -88,7 +88,7 @@ struct ScaledDataConversion< T operator()( F f ) const { - BOOST_STATIC_ASSERT( boost::is_signed< T >::value ); + static_assert( boost::is_signed< T >::value ); float result = static_cast(f) / std::numeric_limits::max() * std::numeric_limits::max(); return static_cast( round( result ) ); } @@ -115,7 +115,7 @@ struct ScaledDataConversion< { T operator()( F f ) const { - BOOST_STATIC_ASSERT( boost::is_unsigned< T >::value ); + static_assert( boost::is_unsigned< T >::value ); f = std::max( f, (F)(std::numeric_limits::min() ) ); float result = static_cast(f) / std::numeric_limits::max() * std::numeric_limits::max(); return static_cast( round( result ) ); @@ -138,7 +138,7 @@ struct ScaledDataConversion< { T operator()( F f ) const { - BOOST_STATIC_ASSERT( boost::is_signed< T >::value ); + static_assert( boost::is_signed< T >::value ); f = std::max( f, (F)( -1.0 ) ); f = std::min( f, (F)( 1.0 ) ); float result = static_cast(f) * std::numeric_limits::max(); @@ -162,7 +162,7 @@ struct ScaledDataConversion< { T operator()( F f ) const { - BOOST_STATIC_ASSERT( boost::is_unsigned< T >::value ); + static_assert( boost::is_unsigned< T >::value ); f = std::max( f, (F)( 0.0 ) ); f = std::min( f, (F)( 1.0 ) ); float result = static_cast(f) * std::numeric_limits::max(); diff --git a/include/IECore/SphericalToEuclideanTransform.h b/include/IECore/SphericalToEuclideanTransform.h index bb11487909..d51c15b8cd 100644 --- a/include/IECore/SphericalToEuclideanTransform.h +++ b/include/IECore/SphericalToEuclideanTransform.h @@ -38,8 +38,6 @@ #include "IECore/SpaceTransform.h" #include "IECore/TypeTraits.h" -#include "boost/static_assert.hpp" - namespace IECore { diff --git a/include/IECore/SweepAndPrune.h b/include/IECore/SweepAndPrune.h index c28628ec44..9eb0a1bfbc 100644 --- a/include/IECore/SweepAndPrune.h +++ b/include/IECore/SweepAndPrune.h @@ -37,8 +37,6 @@ #include "IECore/RadixSort.h" -#include "boost/static_assert.hpp" - #include namespace IECore diff --git a/include/IECore/SweepAndPrune.inl b/include/IECore/SweepAndPrune.inl index f598bb9997..dfcfffe193 100644 --- a/include/IECore/SweepAndPrune.inl +++ b/include/IECore/SweepAndPrune.inl @@ -38,8 +38,6 @@ #include "IECore/BoxTraits.h" #include "IECore/VectorOps.h" -#include "boost/static_assert.hpp" - #include #include #include diff --git a/include/IECore/TypeTraits.h b/include/IECore/TypeTraits.h index 14f1ebf03d..ba311d819c 100644 --- a/include/IECore/TypeTraits.h +++ b/include/IECore/TypeTraits.h @@ -51,7 +51,6 @@ #include "boost/mpl/if.hpp" #include "boost/mpl/not.hpp" #include "boost/mpl/or.hpp" -#include "boost/static_assert.hpp" #include "boost/type_traits.hpp" namespace IECore diff --git a/include/IECore/TypedObjectParameter.inl b/include/IECore/TypedObjectParameter.inl index 8ac3a43bd4..ead14b3c3a 100644 --- a/include/IECore/TypedObjectParameter.inl +++ b/include/IECore/TypedObjectParameter.inl @@ -44,8 +44,6 @@ #include "IECore/Object.h" #include "IECore/TypedObjectParameter.h" -#include "boost/static_assert.hpp" - namespace IECore { diff --git a/include/IECore/TypedParameter.inl b/include/IECore/TypedParameter.inl index 0d9f5650fb..2444eb5a84 100644 --- a/include/IECore/TypedParameter.inl +++ b/include/IECore/TypedParameter.inl @@ -39,8 +39,6 @@ #include "IECore/Export.h" #include "IECore/TypedParameter.h" -#include "boost/static_assert.hpp" - namespace IECore { @@ -100,7 +98,7 @@ TypeId TypedParameter::typeId() const template TypeId TypedParameter::staticTypeId() { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); // this function must be specialised for each type! + static_assert( sizeof(T) == 0 ); // this function must be specialised for each type! return InvalidTypeId; } @@ -113,7 +111,7 @@ const char *TypedParameter::typeName() const template const char *TypedParameter::staticTypeName() { - BOOST_STATIC_ASSERT( sizeof(T) == 0 ); // this function must be specialised for each type! + static_assert( sizeof(T) == 0 ); // this function must be specialised for each type! return ""; } diff --git a/include/IECoreImage/ImagePrimitive.inl b/include/IECoreImage/ImagePrimitive.inl index 8252960769..70081fb93f 100644 --- a/include/IECoreImage/ImagePrimitive.inl +++ b/include/IECoreImage/ImagePrimitive.inl @@ -43,8 +43,6 @@ IECORE_PUSH_DEFAULT_VISIBILITY #include "Imath/half.h" IECORE_POP_DEFAULT_VISIBILITY -#include "boost/static_assert.hpp" - namespace IECoreImage { diff --git a/src/IECore/CachedReader.cpp b/src/IECore/CachedReader.cpp index 1695d29d64..fd907905f0 100644 --- a/src/IECore/CachedReader.cpp +++ b/src/IECore/CachedReader.cpp @@ -191,12 +191,16 @@ struct CachedReader::MemberData ////////////////////////////////////////////////////////////////////////// CachedReader::CachedReader( const SearchPath &paths, ObjectPoolPtr objectPool ) - : m_data( new MemberData( paths, nullptr, objectPool ) ) + : m_data( std::make_unique( paths, nullptr, objectPool ) ) { } CachedReader::CachedReader( const SearchPath &paths, ConstModifyOpPtr postProcessor, ObjectPoolPtr objectPool ) - : m_data( new MemberData( paths, postProcessor, objectPool ) ) + : m_data( std::make_unique( paths, postProcessor, objectPool ) ) +{ +} + +CachedReader::~CachedReader() { } diff --git a/src/IECore/NumericParameter.cpp b/src/IECore/NumericParameter.cpp index ce43687537..38ec2f9ea7 100644 --- a/src/IECore/NumericParameter.cpp +++ b/src/IECore/NumericParameter.cpp @@ -39,8 +39,6 @@ #include "IECore/Export.h" #include "IECore/SimpleTypedData.h" -#include "boost/static_assert.hpp" - using namespace std; using namespace IECore; using namespace boost; diff --git a/src/IECore/Object.cpp b/src/IECore/Object.cpp index a2986fc367..78ba5321fc 100644 --- a/src/IECore/Object.cpp +++ b/src/IECore/Object.cpp @@ -36,7 +36,6 @@ #include "IECore/MurmurHash.h" -#include "boost/shared_ptr.hpp" #include "boost/tokenizer.hpp" #include "fmt/format.h" @@ -405,8 +404,8 @@ ObjectPtr Object::copy() const void Object::save( IndexedIOPtr ioInterface, const IndexedIO::EntryID &name ) const { - boost::shared_ptr context( new SaveContext( ioInterface ) ); - context->save( this, ioInterface.get(), name ); + SaveContext context( ioInterface ); + context.save( this, ioInterface.get(), name ); } void Object::copyFrom( const Object *toCopy ) diff --git a/src/IECore/ObjectPool.cpp b/src/IECore/ObjectPool.cpp index 033b9cbaa3..ffc7fabd6f 100644 --- a/src/IECore/ObjectPool.cpp +++ b/src/IECore/ObjectPool.cpp @@ -66,7 +66,7 @@ struct ObjectPool::MemberData ////////////////////////////////////////////////////////////////////////// ObjectPool::ObjectPool( size_t maxMemory ) - : m_data( new MemberData(maxMemory) ) + : m_data( std::make_unique( maxMemory ) ) { } diff --git a/src/IECore/RadixSort.cpp b/src/IECore/RadixSort.cpp index 7b89baec24..eb70a51749 100644 --- a/src/IECore/RadixSort.cpp +++ b/src/IECore/RadixSort.cpp @@ -36,15 +36,13 @@ #include "IECore/ByteOrder.h" -#include "boost/static_assert.hpp" - #include using namespace IECore; -BOOST_STATIC_ASSERT( sizeof(int) == 4 ); -BOOST_STATIC_ASSERT( sizeof(unsigned int) == 4 ); -BOOST_STATIC_ASSERT( sizeof(float) == 4 ); +static_assert( sizeof(int) == 4 ); +static_assert( sizeof(unsigned int) == 4 ); +static_assert( sizeof(float) == 4 ); RadixSort::RadixSort() : m_currentSize( 0 ), m_ranks( nullptr ), m_ranks2( nullptr ) { @@ -412,7 +410,7 @@ const std::vector &RadixSort::operator()( const std::vector & template bool RadixSort::createHistograms( const std::vector &input ) { - BOOST_STATIC_ASSERT( sizeof(T) == 4 ); + static_assert( sizeof(T) == 4 ); memset( &m_histogram[0], 0, 256 * 4 * sizeof( unsigned int ) ); diff --git a/src/IECore/StreamIndexedIO.cpp b/src/IECore/StreamIndexedIO.cpp index 53494d54cf..0d9feb44e6 100644 --- a/src/IECore/StreamIndexedIO.cpp +++ b/src/IECore/StreamIndexedIO.cpp @@ -2226,7 +2226,7 @@ void StreamIndexedIO::Index::writeNodeChildren( DirectoryNode *n, F &f ) template < typename F > void StreamIndexedIO::Index::writeNode( DirectoryNode *node, F &f ) { - BOOST_STATIC_ASSERT( sizeof( NodeBase::NodeType ) == 1 ); + static_assert( sizeof( NodeBase::NodeType ) == 1 ); NodeBase::NodeType nodeType = node->subindex() ? NodeBase::NodeType::SubIndex : node->nodeType(); f.write( (char *) &nodeType, sizeof( nodeType ) ); diff --git a/src/IECoreImage/ClientDisplayDriver.cpp b/src/IECoreImage/ClientDisplayDriver.cpp index 6358c0ff3f..68e96b50e4 100644 --- a/src/IECoreImage/ClientDisplayDriver.cpp +++ b/src/IECoreImage/ClientDisplayDriver.cpp @@ -49,7 +49,6 @@ #include "IECore/MemoryIndexedIO.h" #include "IECore/SimpleTypedData.h" -#include "boost/array.hpp" #include "boost/bind/bind.hpp" using namespace std; @@ -213,7 +212,7 @@ void ClientDisplayDriver::imageData( const Box2i &box, const float *data, size_t { sendHeader( DisplayDriverServerHeader::imageData, sizeof( box ) + dataSize * sizeof( float ) ); - boost::array buffers = { { + std::array buffers = { { boost::asio::buffer( &box, sizeof( box ) ), boost::asio::buffer( data, dataSize * sizeof( float ) ) } }; diff --git a/src/IECoreImage/ImagePrimitive.cpp b/src/IECoreImage/ImagePrimitive.cpp index 3257766067..72049c95d9 100644 --- a/src/IECoreImage/ImagePrimitive.cpp +++ b/src/IECoreImage/ImagePrimitive.cpp @@ -39,8 +39,6 @@ #include "IECore/MurmurHash.h" #include "IECore/TypeTraits.h" -#include "boost/static_assert.hpp" - #include using namespace std; diff --git a/src/IECoreImage/ImageWriter.cpp b/src/IECoreImage/ImageWriter.cpp index 92e7c265e2..701cf551f2 100644 --- a/src/IECoreImage/ImageWriter.cpp +++ b/src/IECoreImage/ImageWriter.cpp @@ -57,7 +57,6 @@ #include "boost/mpl/if.hpp" #include "boost/mpl/not.hpp" #include "boost/mpl/or.hpp" -#include "boost/static_assert.hpp" #include "boost/type_traits.hpp" #ifndef _MSC_VER diff --git a/src/IECorePython/LineSegmentBinding.cpp b/src/IECorePython/LineSegmentBinding.cpp index f1cac0a295..75e2bf93b1 100644 --- a/src/IECorePython/LineSegmentBinding.cpp +++ b/src/IECorePython/LineSegmentBinding.cpp @@ -40,8 +40,6 @@ #include "IECore/LineSegment.h" -#include "boost/static_assert.hpp" - #include using namespace boost::python; @@ -53,7 +51,7 @@ namespace IECorePython template static const char *typeName() { - BOOST_STATIC_ASSERT( sizeof(L) == 0 ); + static_assert( sizeof(L) == 0 ); return ""; } diff --git a/src/IECoreScene/SceneCache.cpp b/src/IECoreScene/SceneCache.cpp index 84d8493a94..faa1035c7d 100644 --- a/src/IECoreScene/SceneCache.cpp +++ b/src/IECoreScene/SceneCache.cpp @@ -54,7 +54,6 @@ #include "Imath/ImathBoxAlgo.h" #include "boost/core/demangle.hpp" -#include "boost/tuple/tuple.hpp" #include "tbb/concurrent_hash_map.h" @@ -865,7 +864,7 @@ class SceneCache::ReaderImplementation : public SceneCache::Implementation typedef tbb::spin_rw_mutex AttributeMapMutex; typedef std::pair< const ReaderImplementation *, size_t > SimpleCacheKey; - typedef tuple< const ReaderImplementation *, const SceneCache::Name &, size_t > AttributeCacheKey; + using AttributeCacheKey = std::tuple< const ReaderImplementation *, const SceneCache::Name &, size_t >; typedef IECore::ComputationCache< SimpleCacheKey > SimpleCache; typedef IECore::ComputationCache< AttributeCacheKey > AttributeCache; diff --git a/src/IECoreScene/TypedPrimitiveOp.cpp b/src/IECoreScene/TypedPrimitiveOp.cpp index 4e09b74ff4..3e870062cf 100644 --- a/src/IECoreScene/TypedPrimitiveOp.cpp +++ b/src/IECoreScene/TypedPrimitiveOp.cpp @@ -43,8 +43,6 @@ #include "IECore/NullObject.h" #include "IECore/TypedObjectParameter.h" -#include "boost/static_assert.hpp" - using namespace IECore; using namespace IECoreScene; diff --git a/test/IECore/TypeTraitsTest.cpp b/test/IECore/TypeTraitsTest.cpp index 155241c44e..a6320c6087 100644 --- a/test/IECore/TypeTraitsTest.cpp +++ b/test/IECore/TypeTraitsTest.cpp @@ -38,150 +38,150 @@ using namespace IECore; using namespace IECore::TypeTraits; // ValueType -BOOST_STATIC_ASSERT( (sizeof( ValueType< M33fData >::type ) == sizeof( M33fData::ValueType ) ) ); -BOOST_STATIC_ASSERT( (sizeof( ValueType< FloatVectorData >::type ) == sizeof( FloatVectorData::ValueType ) ) ); +static_assert( (sizeof( ValueType< M33fData >::type ) == sizeof( M33fData::ValueType ) ) ); +static_assert( (sizeof( ValueType< FloatVectorData >::type ) == sizeof( FloatVectorData::ValueType ) ) ); /// IsMatrix -BOOST_STATIC_ASSERT( (IsMatrix< const Imath::M33f >::value) ); -BOOST_STATIC_ASSERT( (IsMatrix< Imath::M44d >::value) ); -BOOST_STATIC_ASSERT( (IsMatrix< ValueType< M33fData >::type >::value ) ); -BOOST_STATIC_ASSERT( (boost::mpl::not_< IsMatrix< Imath::V2i > >::value) ); +static_assert( (IsMatrix< const Imath::M33f >::value) ); +static_assert( (IsMatrix< Imath::M44d >::value) ); +static_assert( (IsMatrix< ValueType< M33fData >::type >::value ) ); +static_assert( (boost::mpl::not_< IsMatrix< Imath::V2i > >::value) ); /// IsVec3 -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVec3 >::value) ); +static_assert( ( boost::mpl::not_< IsVec3 >::value) ); /// IsVec2 -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVec2 >::value) ); +static_assert( ( boost::mpl::not_< IsVec2 >::value) ); /// IsVec -BOOST_STATIC_ASSERT( (IsVec::value) ); -BOOST_STATIC_ASSERT( (IsVec::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVec >::value) ); +static_assert( (IsVec::value) ); +static_assert( (IsVec::value) ); +static_assert( ( boost::mpl::not_< IsVec >::value) ); /// IsColor3 -BOOST_STATIC_ASSERT( ( IsColor3::value ) ); -BOOST_STATIC_ASSERT( ( IsColor3::value ) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsColor3 >::value) ); +static_assert( ( IsColor3::value ) ); +static_assert( ( IsColor3::value ) ); +static_assert( ( boost::mpl::not_< IsColor3 >::value) ); /// IsColor4 -BOOST_STATIC_ASSERT( ( IsColor4::value ) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsColor4 >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsColor4 >::value) ); +static_assert( ( IsColor4::value ) ); +static_assert( ( boost::mpl::not_< IsColor4 >::value) ); +static_assert( ( boost::mpl::not_< IsColor4 >::value) ); /// IsColor -BOOST_STATIC_ASSERT( (IsColor::value) ); -BOOST_STATIC_ASSERT( (IsColor::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsColor >::value) ); +static_assert( (IsColor::value) ); +static_assert( (IsColor::value) ); +static_assert( ( boost::mpl::not_< IsColor >::value) ); /// IsQuat -BOOST_STATIC_ASSERT( (IsQuat::value) ); -BOOST_STATIC_ASSERT( (IsQuat::value) ); +static_assert( (IsQuat::value) ); +static_assert( (IsQuat::value) ); /// IsBox -BOOST_STATIC_ASSERT( (IsBox::value) ); +static_assert( (IsBox::value) ); /// IsMatrixTypedData -BOOST_STATIC_ASSERT( (IsMatrixTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsMatrixTypedData >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsMatrixTypedData >::value) ); +static_assert( (IsMatrixTypedData::value) ); +static_assert( ( boost::mpl::not_< IsMatrixTypedData >::value) ); +static_assert( ( boost::mpl::not_< IsMatrixTypedData >::value) ); /// IsVec2TypedData -BOOST_STATIC_ASSERT( (IsVec2TypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVec2TypedData >::value) ); +static_assert( (IsVec2TypedData::value) ); +static_assert( ( boost::mpl::not_< IsVec2TypedData >::value) ); /// IsVec2VectorTypedData -BOOST_STATIC_ASSERT( (IsVec2VectorTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVec2VectorTypedData >::value) ); +static_assert( (IsVec2VectorTypedData::value) ); +static_assert( ( boost::mpl::not_< IsVec2VectorTypedData >::value) ); /// IsVec3TypedData -BOOST_STATIC_ASSERT( (IsVec3TypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVec3TypedData >::value) ); +static_assert( (IsVec3TypedData::value) ); +static_assert( ( boost::mpl::not_< IsVec3TypedData >::value) ); /// IsVec3VectorTypedData -BOOST_STATIC_ASSERT( (IsVec3VectorTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVec3VectorTypedData >::value) ); +static_assert( (IsVec3VectorTypedData::value) ); +static_assert( ( boost::mpl::not_< IsVec3VectorTypedData >::value) ); /// IsVecTypedData -BOOST_STATIC_ASSERT( (IsVecTypedData::value) ); -BOOST_STATIC_ASSERT( (IsVecTypedData::value) ); -BOOST_STATIC_ASSERT( (IsVecTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVecTypedData >::value) ); +static_assert( (IsVecTypedData::value) ); +static_assert( (IsVecTypedData::value) ); +static_assert( (IsVecTypedData::value) ); +static_assert( ( boost::mpl::not_< IsVecTypedData >::value) ); /// IsVecVectorTypedData -BOOST_STATIC_ASSERT( (IsVecVectorTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsVecVectorTypedData >::value) ); +static_assert( (IsVecVectorTypedData::value) ); +static_assert( ( boost::mpl::not_< IsVecVectorTypedData >::value) ); /// IsNumericVectorTypedData -BOOST_STATIC_ASSERT( (IsNumericVectorTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericVectorTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericVectorTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericVectorTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericVectorTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsNumericVectorTypedData >::value) ); +static_assert( (IsNumericVectorTypedData::value) ); +static_assert( (IsNumericVectorTypedData::value) ); +static_assert( (IsNumericVectorTypedData::value) ); +static_assert( (IsNumericVectorTypedData::value) ); +static_assert( (IsNumericVectorTypedData::value) ); +static_assert( ( boost::mpl::not_< IsNumericVectorTypedData >::value) ); /// IsFloatVectorTypedData -BOOST_STATIC_ASSERT( (IsFloatVectorTypedData::value) ); -BOOST_STATIC_ASSERT( (IsFloatVectorTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsFloatVectorTypedData >::value) ); +static_assert( (IsFloatVectorTypedData::value) ); +static_assert( (IsFloatVectorTypedData::value) ); +static_assert( ( boost::mpl::not_< IsFloatVectorTypedData >::value) ); /// IsNumericSimpleTypedData -BOOST_STATIC_ASSERT( (IsNumericSimpleTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericSimpleTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericSimpleTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericSimpleTypedData::value) ); -BOOST_STATIC_ASSERT( (IsNumericSimpleTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsNumericSimpleTypedData >::value) ); +static_assert( (IsNumericSimpleTypedData::value) ); +static_assert( (IsNumericSimpleTypedData::value) ); +static_assert( (IsNumericSimpleTypedData::value) ); +static_assert( (IsNumericSimpleTypedData::value) ); +static_assert( (IsNumericSimpleTypedData::value) ); +static_assert( ( boost::mpl::not_< IsNumericSimpleTypedData >::value) ); /// IsInterpolable -BOOST_STATIC_ASSERT( (IsInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsInterpolable >::value) ); -BOOST_STATIC_ASSERT( (IsInterpolable > >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsInterpolable >::value) ); +static_assert( (IsInterpolable::value) ); +static_assert( (IsInterpolable::value) ); +static_assert( (IsInterpolable::value) ); +static_assert( (IsInterpolable::value) ); +static_assert( (IsInterpolable >::value) ); +static_assert( (IsInterpolable > >::value) ); +static_assert( ( boost::mpl::not_< IsInterpolable >::value) ); /// IsStrictlyInterpolable -BOOST_STATIC_ASSERT( (IsStrictlyInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsStrictlyInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsStrictlyInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsStrictlyInterpolable::value) ); -BOOST_STATIC_ASSERT( (IsStrictlyInterpolable >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsStrictlyInterpolable > > >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsStrictlyInterpolable >::value) ); +static_assert( (IsStrictlyInterpolable::value) ); +static_assert( (IsStrictlyInterpolable::value) ); +static_assert( (IsStrictlyInterpolable::value) ); +static_assert( (IsStrictlyInterpolable::value) ); +static_assert( (IsStrictlyInterpolable >::value) ); +static_assert( ( boost::mpl::not_< IsStrictlyInterpolable > > >::value) ); +static_assert( ( boost::mpl::not_< IsStrictlyInterpolable >::value) ); /// IsInterpolableVectorTypedData -BOOST_STATIC_ASSERT( (IsInterpolableVectorTypedData::value) ); -BOOST_STATIC_ASSERT( (IsInterpolableVectorTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsInterpolableVectorTypedData >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsInterpolableVectorTypedData >::value) ); +static_assert( (IsInterpolableVectorTypedData::value) ); +static_assert( (IsInterpolableVectorTypedData::value) ); +static_assert( ( boost::mpl::not_< IsInterpolableVectorTypedData >::value) ); +static_assert( ( boost::mpl::not_< IsInterpolableVectorTypedData >::value) ); /// IsInterpolableSimpleTypedData -BOOST_STATIC_ASSERT( (IsInterpolableSimpleTypedData::value) ); -BOOST_STATIC_ASSERT( (IsInterpolableSimpleTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsInterpolableSimpleTypedData >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsInterpolableSimpleTypedData >::value) ); +static_assert( (IsInterpolableSimpleTypedData::value) ); +static_assert( (IsInterpolableSimpleTypedData::value) ); +static_assert( ( boost::mpl::not_< IsInterpolableSimpleTypedData >::value) ); +static_assert( ( boost::mpl::not_< IsInterpolableSimpleTypedData >::value) ); /// IsGeometricTypedData -BOOST_STATIC_ASSERT( ( IsGeometricTypedData::value) ); -BOOST_STATIC_ASSERT( ( IsGeometricTypedData::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsGeometricTypedData >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsGeometricTypedData >::value) ); -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsGeometricTypedData >::value) ); +static_assert( ( IsGeometricTypedData::value) ); +static_assert( ( IsGeometricTypedData::value) ); +static_assert( ( boost::mpl::not_< IsGeometricTypedData >::value) ); +static_assert( ( boost::mpl::not_< IsGeometricTypedData >::value) ); +static_assert( ( boost::mpl::not_< IsGeometricTypedData >::value) ); /// IsSpline -BOOST_STATIC_ASSERT( (IsSpline< Spline >::value) ); -BOOST_STATIC_ASSERT( (boost::mpl::not_< IsSpline< Imath::V2f > >::value) ); +static_assert( (IsSpline< Spline >::value) ); +static_assert( (boost::mpl::not_< IsSpline< Imath::V2f > >::value) ); /// IsSplineTypedData -BOOST_STATIC_ASSERT( (IsSplineTypedData::value) ); -BOOST_STATIC_ASSERT( (IsSplineTypedData::value) ); -BOOST_STATIC_ASSERT( (IsSplineTypedData::value) ); -BOOST_STATIC_ASSERT( (boost::mpl::not_< IsSplineTypedData< Imath::V2f > >::value) ); -BOOST_STATIC_ASSERT( (boost::mpl::not_< IsSplineTypedData< FloatData > >::value) ); +static_assert( (IsSplineTypedData::value) ); +static_assert( (IsSplineTypedData::value) ); +static_assert( (IsSplineTypedData::value) ); +static_assert( (boost::mpl::not_< IsSplineTypedData< Imath::V2f > >::value) ); +static_assert( (boost::mpl::not_< IsSplineTypedData< FloatData > >::value) ); /// IsStringVectorTypedData -BOOST_STATIC_ASSERT( ( boost::mpl::not_< IsStringVectorTypedData >::value) ); -BOOST_STATIC_ASSERT( ( IsStringVectorTypedData::value ) ); -BOOST_STATIC_ASSERT( ( IsStringVectorTypedData::value ) ); +static_assert( ( boost::mpl::not_< IsStringVectorTypedData >::value) ); +static_assert( ( IsStringVectorTypedData::value ) ); +static_assert( ( IsStringVectorTypedData::value ) );