Commit 685d26c0 authored by Romain Pacanowski's avatar Romain Pacanowski

added a static function to retrieve the size in bytes of the template type

parent a4f4b275
......@@ -195,7 +195,7 @@ class Vec3
* Returns a vector where std::pow has been applied to each component
*/
inline Vec3<T> pow(T const & power) const;
static inline Vec3<T> interpolate ( Vec3<T> const & u, Vec3<T> const & v, T alpha = T(0.5) );
......@@ -209,6 +209,8 @@ class Vec3
inline void setConstant( T cte_value );
static inline unsigned int sizeOfT() ;
private:
/*----- data members -----*/
......@@ -973,7 +975,7 @@ inline void Vec3<T>::pow(T const & power)
}
template<class T>
inline Vec3<T>
inline Vec3<T>
Vec3<T>::pow(T const & power) const
{
return Vec3<T>( std::pow(_e[0], power),
......@@ -1068,12 +1070,17 @@ Vec3<T>::setConstant( T cte_value )
setZ(cte_value);
}
template <class T>
inline unsigned int Vec3<T>::sizeOfT()
{
return sizeof(T);
}
/*==============================================================================
TYPEDEF
==============================================================================*/
TYPEDEF
==============================================================================*/
typedef Vec3< int > Vec3i;
typedef Vec3<int> Vec3i;
typedef Vec3< unsigned int > Vec3ui;
typedef Vec3< float > Vec3f;
typedef Vec3< double > Vec3d;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment