temptst.h

Go to the documentation of this file.
00001 #ifndef TEMPTST_H
00002 
00003 template<class T>
00004 class N1 {
00005 private:
00006   T data_;
00007 public:
00008   ~N1() { }
00009   T data() const {return data_;}
00010   T sqr() const;
00011   const N1<T>& operator=(const N1<T>& v);
00012   N1(const N1<T>& v) {
00013     operator=(v);
00014   }
00015   N1(T d1):  data_(d1) { }
00016 };
00017 
00018 
00019 template<class T>
00020 T N1<T>::sqr() const {
00021   return data_ * data_;
00022 }
00023 
00024 template<class T>
00025 const N1<T>& N1<T>::operator=(const N1<T>& v) {
00026   data_ = v.data();
00027   return *this;
00028 }
00029 
00030 #endif
00031 
00032 #define TEMPTST_H

Generated on Sun Mar 4 15:03:58 2007 for Scilab [trunk] by  doxygen 1.5.1