Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

NewArray.h

Go to the documentation of this file.
00001 // Copyright (C) 2003 Johan Jansson.
00002 // Licensed under the GNU GPL Version 2.
00003 //
00004 // - Updates by Anders Logg, 2003
00005 
00006 #ifndef __NEWARRAY_H
00007 #define __NEWARRAY_H
00008 
00009 #include <vector>
00010 
00011 namespace dolfin {
00012 
00018   
00019   template <class T>
00020   class NewArray : public std::vector<T>
00021   {
00022   public:
00023 
00025     NewArray() : std::vector<T>() {}
00026     
00028     NewArray(int n) : std::vector<T>(n) {}
00029 
00031     const NewArray& operator=(const T& element)
00032     {
00033       for (unsigned int i = 0; i < size(); i++)
00034         (*this)[i] = element;
00035       
00036       return *this;
00037     }
00038 
00039   };
00040 
00041 }
00042 
00043 #endif


Documentation automatically generated with Doxygen on 10 Sep 2004.