Results 1 to 4 of 4

Thread: Vector-class with template

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sergeant serthy's Avatar
    Join Date
    Nov 2012
    Posts
    450
    Thanks
    96
    Thanked 296 Times in 188 Posts
    PHP Code:
    templatetypename T >
    class 
    Vec3
    {
        public:

            
    T x 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);
    };

    templatetypename T >
    template< class Tvec >
    Vec3>::Vec3( const Tvec)
    {
        
    this->Tv.);
        
    this->Tv.);
        
    this->Tv.);

    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
    Last edited by serthy; 10th December 2013 at 19:42. Reason: Uhm imanidiot

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •