/[enigma]/enigma/src/px/array2.hh
ViewVC logotype

Diff of /enigma/src/px/array2.hh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by dheck, Sun Mar 23 17:17:21 2003 UTC revision 1.4 by dheck, Sun May 18 18:45:07 2003 UTC
# Line 91  namespace px Line 91  namespace px
91          T&       operator()(size_type x, size_type y) { return get(x,y); }          T&       operator()(size_type x, size_type y) { return get(x,y); }
92          const T& operator()(size_type x, size_type y) const { return get(x,y); }          const T& operator()(size_type x, size_type y) const { return get(x,y); }
93    
94          void     set(size_type x, size_type y, const T& val)          void     set(size_type x, size_type y, const T& val) {
         {  
95              first[y*w+x] = val;              first[y*w+x] = val;
96          }          }
97    
# Line 104  namespace px Line 103  namespace px
103          void resize (int w, int h, const T& val=T());          void resize (int w, int h, const T& val=T());
104    
105      private:      private:
106          size_type w, h;          void destroy_elements();
107    
108          void destroy_elements() {          size_type w, h;
             for (T* p=first; p!=last; ++p)  
                 p->~T();  
         }  
109      };      };
110    
111      template <class T, class A>      template <class T, class A>
# Line 127  namespace px Line 123  namespace px
123      }      }
124    
125      template <class T, class A>      template <class T, class A>
126        void Array2<T,A>::destroy_elements() {
127            for (T* p=first; p!=last; ++p)
128                p->~T();
129        }
130    
131        template <class T, class A>
132      void Array2<T,A>::fill (const T& val)      void Array2<T,A>::fill (const T& val)
133      {      {
134          destroy_elements();          destroy_elements();

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26