Go to the documentation of this file.00001
00006 #ifndef MAXPLUS_HH
00007 #define MAXPLUS_HH
00008
00009 #include<iostream>
00010
00011 namespace my_lib {
00012
00013 template<typename T>
00014 class MaxPlus;
00015
00026 template<typename T>
00027 std::ostream& operator<< (std::ostream& o, const MaxPlus<T>& x);
00028
00039 template<typename T>
00040 std::istream& operator>> (std::istream& i, MaxPlus<T>& x);
00041
00049 template<typename T>
00050 class MaxPlus {
00051 private:
00052 T value;
00053 public:
00059 explicit MaxPlus(const T& v);
00067 MaxPlus& operator +=(const MaxPlus& x);
00075 MaxPlus operator +(const MaxPlus&) const;
00083 MaxPlus& operator *=(const MaxPlus&);
00091 MaxPlus operator *(const MaxPlus&) const;
00096 operator T() const;
00097
00107 static const MaxPlus& get_zero();
00108
00110 friend std::ostream& operator<< <T>(std::ostream&, const MaxPlus<T>&);
00112 friend std::istream& operator>> <T>(std::istream&, MaxPlus<T>&);
00113 };
00114
00115 }
00116
00117 #include<my_lib/MaxPlus.hxx>
00118 #endif //MAXPLUS_HH
00119