OSDN Git Service

adapter/adapter.hpp: あちこち手直し
authorMyun2 <myun2@nwhite.info>
Thu, 9 Sep 2010 16:56:48 +0000 (01:56 +0900)
committerMyun2 <myun2@nwhite.info>
Thu, 9 Sep 2010 16:56:48 +0000 (01:56 +0900)
roast/include/roast/adapter/adapter.hpp

index c234dae..0cd68f6 100644 (file)
@@ -12,34 +12,36 @@ namespace roast
                /////////////////////////////////////////////////////////////////////////
                
                template <typename _Facade, typename T>
-               class inc_decl
+               class operator_inc_decl
                {
                private:
                        T& m_value;
                public:
-                       inc_decl(T& value) : m_value(value) {}
+                       operator_inc_decl(T& value) : m_value(value) {}
                
                        _Facade& operator ++(int){ m_value++; return *this; }
                        _Facade& operator --(int){ m_value--; return *this; }
-                       _Facade& operator ++(){ _Facade work=*this; m_value++; return work; }
-                       _Facade& operator --(){ _Facade work=*this; m_value--; return work; }
+                       _Facade& operator ++(){ _Facade work=*this; work++; return work; }
+                       _Facade& operator --(){ _Facade work=*this; work--; return work; }
                };
                
                /////////////////////////////////////////////////////////////////////////
                
                template <typename _Facade, typename T>
-               class plus_minus
+               class operator_plus_minus
                {
                protected:
                        T& m_value;
                public:
-                       plus_minus(T& value) : m_value(value) {}
+                       operator_plus_minus(T& value) : m_value(value) {}
                
-                       _Facade& operator +=(int n){ m_index+=n; return *this; }
-                       _Facade& operator -=(int n){ m_index-=n; return *this; }
+                       _Facade& operator +=(int n){ m_value+=n; return *this; }
+                       _Facade& operator -=(int n){ m_value-=n; return *this; }
                        _Facade& operator +(int n){ _Facade work=*this; work+=n; return work; }
                        _Facade& operator -(int n){ _Facade work=*this; work-=n; return work; }
                };
+
+               /////////////////////////////////////////////////////////////////////////
        }
 }