Loading src/TNL/Pointers/UniquePointer.h +52 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,30 @@ class UniquePointer< Object, Devices::Host > : public SmartPointer this->pointer = new Object( args... ); } /** * \brief Constructor with initializer list. * * \tparam Value is type of the initializer list elements. * \param list is the instance of the initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< Value > list ) { this->pointer = new Object( list ); } /** * \brief Constructor with nested initializer lists. * * \tparam Value is type of the nested initializer list elements. * \param list is the instance of the nested initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< std::initializer_list< Value > > list ) { this->pointer = new Object( list ); } /** * \brief Arrow operator for accessing the object owned by constant smart pointer. * Loading Loading @@ -300,6 +324,34 @@ class UniquePointer< Object, Devices::Cuda > : public SmartPointer this->allocate( args... ); } /** * \brief Constructor with initializer list. * * \tparam Value is type of the initializer list elements. * \param list is the instance of the initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< Value > list ) : pd( nullptr ), cuda_pointer( nullptr ) { this->allocate( list ); } /** * \brief Constructor with nested initializer lists. * * \tparam Value is type of the nested initializer list elements. * \param list is the instance of the nested initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< std::initializer_list< Value > > list ) : pd( nullptr ), cuda_pointer( nullptr ) { this->allocate( list ); } /** * \brief Arrow operator for accessing the object owned by constant smart pointer. * Loading Loading
src/TNL/Pointers/UniquePointer.h +52 −0 Original line number Diff line number Diff line Loading @@ -96,6 +96,30 @@ class UniquePointer< Object, Devices::Host > : public SmartPointer this->pointer = new Object( args... ); } /** * \brief Constructor with initializer list. * * \tparam Value is type of the initializer list elements. * \param list is the instance of the initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< Value > list ) { this->pointer = new Object( list ); } /** * \brief Constructor with nested initializer lists. * * \tparam Value is type of the nested initializer list elements. * \param list is the instance of the nested initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< std::initializer_list< Value > > list ) { this->pointer = new Object( list ); } /** * \brief Arrow operator for accessing the object owned by constant smart pointer. * Loading Loading @@ -300,6 +324,34 @@ class UniquePointer< Object, Devices::Cuda > : public SmartPointer this->allocate( args... ); } /** * \brief Constructor with initializer list. * * \tparam Value is type of the initializer list elements. * \param list is the instance of the initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< Value > list ) : pd( nullptr ), cuda_pointer( nullptr ) { this->allocate( list ); } /** * \brief Constructor with nested initializer lists. * * \tparam Value is type of the nested initializer list elements. * \param list is the instance of the nested initializer list.. */ template< typename Value > explicit UniquePointer( std::initializer_list< std::initializer_list< Value > > list ) : pd( nullptr ), cuda_pointer( nullptr ) { this->allocate( list ); } /** * \brief Arrow operator for accessing the object owned by constant smart pointer. * Loading