PHP Code:
template< typename T >
class Vec3
{
public:
T x , y , z;
//explicit to stop unlimited implicit typeconersations a la Vec3<int> v = randomType;
//you have declare it this way: Vec3<int> v( randomType );
template< class Tvec >
explicit Vec3( const Tvec& v );
};
template< typename T >
template< class Tvec >
Vec3< T >::Vec3( const Tvec& v )
{
this->x = T( v.x );
this->y = T( v.y );
this->z = T( v.z );
}
seems to work
EDIT:
seems that my first example now compiles fine also.. ;(
@kung under me: heheheh we will see, give me some time xxP