Loading src/TNL/Containers/Algorithms/ArrayAssignment.h +4 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,10 @@ private: typedef char NoType[2]; template< typename C > static YesType& test( decltype(&C::getArrayData) ); template< typename C > static NoType& test(...); //template< typename C > static NoType& test(...); public: enum { value = sizeof( test< T >(0) ) == sizeof( YesType ) }; static constexpr bool value = ( sizeof( test< T >(0) ) == sizeof( YesType ) ); }; } // namespace Details Loading @@ -58,7 +58,7 @@ struct ArrayAssignment< Array, T, true > /** * \brief Specialization for array-value assignment for other types. We assume * thet T is convertible to Array::ValueType. * that T is convertible to Array::ValueType. */ template< typename Array, typename T > Loading src/TNL/Containers/Array.h +1 −1 Original line number Diff line number Diff line Loading @@ -492,7 +492,7 @@ class Array : public Object /** * \brief Returns true if non-zero size is set. */ operator bool() const; //operator bool() const; /** * \brief Method for saving the object to a \e file as a binary data. Loading src/TNL/Containers/Array.hpp +4 −4 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ Array( Value* data, { } /*template< typename Value, template< typename Value, typename Device, typename Index > Array< Value, Device, Index >:: Loading @@ -76,7 +76,7 @@ Array( const Array< Value, Device, Index >& array ) // Deep copy does not work because of EllpackIndexMultiMap - TODO: Fix it this->setSize( array.getSize() ); Algorithms::ArrayOperations< Device >::copyMemory( this->getData(), array.getData(), array.getSize() ); }*/ } template< typename Value, typename Device, Loading Loading @@ -636,13 +636,13 @@ containsOnlyValue( const Value& v, return Algorithms::ArrayOperations< Device >::containsOnlyValue( &this->getData()[ begin ], end - begin, v ); } template< typename Value, /*template< typename Value, typename Device, typename Index > Array< Value, Device, Index >::operator bool() const { return data != 0; } }*/ template< typename Value, Loading src/UnitTests/Containers/ArrayTest.h +5 −3 Original line number Diff line number Diff line Loading @@ -216,11 +216,11 @@ TYPED_TEST( ArrayTest, setSize ) EXPECT_NE( v.getData(), u.getData() ); // cast to bool returns true iff size > 0 EXPECT_TRUE( (bool) u ); /*EXPECT_TRUE( (bool) u ); EXPECT_FALSE( ! u ); u.setSize( 0 ); EXPECT_FALSE( (bool) u ); EXPECT_TRUE( ! u ); EXPECT_TRUE( ! u );*/ } TYPED_TEST( ArrayTest, setLike ) Loading Loading @@ -462,7 +462,9 @@ TYPED_TEST( ArrayTest, assignmentOperator ) u_host.setElement( i, i ); } v.setValue( 0 ); v = 72; //.setValue( 0 ); for( int i = 0; i < 10; i++ ) EXPECT_EQ( v[ i ], 72 ); v = u; EXPECT_EQ( u, v ); Loading Loading
src/TNL/Containers/Algorithms/ArrayAssignment.h +4 −4 Original line number Diff line number Diff line Loading @@ -28,10 +28,10 @@ private: typedef char NoType[2]; template< typename C > static YesType& test( decltype(&C::getArrayData) ); template< typename C > static NoType& test(...); //template< typename C > static NoType& test(...); public: enum { value = sizeof( test< T >(0) ) == sizeof( YesType ) }; static constexpr bool value = ( sizeof( test< T >(0) ) == sizeof( YesType ) ); }; } // namespace Details Loading @@ -58,7 +58,7 @@ struct ArrayAssignment< Array, T, true > /** * \brief Specialization for array-value assignment for other types. We assume * thet T is convertible to Array::ValueType. * that T is convertible to Array::ValueType. */ template< typename Array, typename T > Loading
src/TNL/Containers/Array.h +1 −1 Original line number Diff line number Diff line Loading @@ -492,7 +492,7 @@ class Array : public Object /** * \brief Returns true if non-zero size is set. */ operator bool() const; //operator bool() const; /** * \brief Method for saving the object to a \e file as a binary data. Loading
src/TNL/Containers/Array.hpp +4 −4 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ Array( Value* data, { } /*template< typename Value, template< typename Value, typename Device, typename Index > Array< Value, Device, Index >:: Loading @@ -76,7 +76,7 @@ Array( const Array< Value, Device, Index >& array ) // Deep copy does not work because of EllpackIndexMultiMap - TODO: Fix it this->setSize( array.getSize() ); Algorithms::ArrayOperations< Device >::copyMemory( this->getData(), array.getData(), array.getSize() ); }*/ } template< typename Value, typename Device, Loading Loading @@ -636,13 +636,13 @@ containsOnlyValue( const Value& v, return Algorithms::ArrayOperations< Device >::containsOnlyValue( &this->getData()[ begin ], end - begin, v ); } template< typename Value, /*template< typename Value, typename Device, typename Index > Array< Value, Device, Index >::operator bool() const { return data != 0; } }*/ template< typename Value, Loading
src/UnitTests/Containers/ArrayTest.h +5 −3 Original line number Diff line number Diff line Loading @@ -216,11 +216,11 @@ TYPED_TEST( ArrayTest, setSize ) EXPECT_NE( v.getData(), u.getData() ); // cast to bool returns true iff size > 0 EXPECT_TRUE( (bool) u ); /*EXPECT_TRUE( (bool) u ); EXPECT_FALSE( ! u ); u.setSize( 0 ); EXPECT_FALSE( (bool) u ); EXPECT_TRUE( ! u ); EXPECT_TRUE( ! u );*/ } TYPED_TEST( ArrayTest, setLike ) Loading Loading @@ -462,7 +462,9 @@ TYPED_TEST( ArrayTest, assignmentOperator ) u_host.setElement( i, i ); } v.setValue( 0 ); v = 72; //.setValue( 0 ); for( int i = 0; i < 10; i++ ) EXPECT_EQ( v[ i ], 72 ); v = u; EXPECT_EQ( u, v ); Loading