diff -p --exclude=Makefile.am --exclude=Makefile.in common/array.hh ../dune-common-1.1/common/array.hh
*** common/array.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/array.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,6 ****
--- 1,12 ----
  #ifndef DUNE_ARRAY_HH
  #define DUNE_ARRAY_HH
  
+ /** \file
+     \brief A dynamical array class, similar to std::vector
+     \deprecated Use std::vector instead of Dune::Array
+ */
+ #warning This file is deprecated.  Please use std::vector instead of Dune::Array!
+ 
  #include<iostream>
  #include<iomanip>
  #include<string>
diff -p --exclude=Makefile.am --exclude=Makefile.in common/arraylist.hh ../dune-common-1.1/common/arraylist.hh
*** common/arraylist.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/arraylist.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: arraylist.hh 2307 2005-06-30 08:18:58Z mblatt $
  
  #ifndef DUNE_ARRAYLIST_HH
  #define DUNE_ARRAYLIST_HH
--- 1,4 ----
! // $Id: arraylist.hh 4926 2007-04-25 13:17:49Z sander $
  
  #ifndef DUNE_ARRAYLIST_HH
  #define DUNE_ARRAYLIST_HH
*************** namespace Dune
*** 37,43 ****
     *
     * Internally the data is organized in a list of arrays of fixed size. 
     * Whenever the capacity of the array list is not sufficient a new 
!    * Dune::FixedArray is allocated. In contrast to 
     * std::vector this approach prevents data copying. On the outside
     * we provide the same interface as the stl random access containers.
     */
--- 37,43 ----
     *
     * Internally the data is organized in a list of arrays of fixed size. 
     * Whenever the capacity of the array list is not sufficient a new 
!    * Dune::array is allocated. In contrast to 
     * std::vector this approach prevents data copying. On the outside
     * we provide the same interface as the stl random access containers.
     */
*************** namespace Dune
*** 186,192 ****
      /**
       * @brief The allocators for the fixed array.
       */
!     typedef typename A::template rebind<SmartPointer<FixedArray<MemberType,chunkSize_> > >::other
      SmartPointerAllocator;
      
      /**
--- 186,192 ----
      /**
       * @brief The allocators for the fixed array.
       */
!     typedef typename A::template rebind<SmartPointer<array<MemberType,chunkSize_> > >::other
      SmartPointerAllocator;
      
      /**
*************** namespace Dune
*** 196,202 ****
      friend class ConstArrayListIterator<T,N,A>;
      
      /** @brief the data chunks of our list. */
!     std::vector<SmartPointer<FixedArray<MemberType,chunkSize_> >,
                  SmartPointerAllocator> chunks_;
      /** @brief The current data capacity. */
      size_type capacity_;
--- 196,202 ----
      friend class ConstArrayListIterator<T,N,A>;
      
      /** @brief the data chunks of our list. */
!     std::vector<SmartPointer<array<MemberType,chunkSize_> >,
                  SmartPointerAllocator> chunks_;
      /** @brief The current data capacity. */
      size_type capacity_;
*************** namespace Dune
*** 471,477 ****
      size_t index=start_+size_;
      if(index==capacity_)
        {
!         chunks_.push_back(SmartPointer<FixedArray<MemberType,chunkSize_> >());
          capacity_ += chunkSize_;
        }
      elementAt(index)=entry;
--- 471,477 ----
      size_t index=start_+size_;
      if(index==capacity_)
        {
!         chunks_.push_back(SmartPointer<array<MemberType,chunkSize_> >());
          capacity_ += chunkSize_;
        }
      elementAt(index)=entry;
*************** namespace Dune
*** 537,543 ****
        // Number of chunks with entries in it;
        size_t chunks = ((start_%chunkSize_ + size_)/chunkSize_ );
        
!       typedef typename std::vector<SmartPointer<FixedArray<MemberType,
  	chunkSize_> > >::iterator iterator;
  
        // Copy chunks to the left.
--- 537,543 ----
        // Number of chunks with entries in it;
        size_t chunks = ((start_%chunkSize_ + size_)/chunkSize_ );
        
!       typedef typename std::vector<SmartPointer<array<MemberType,
  	chunkSize_> > >::iterator iterator;
  
        // Copy chunks to the left.
diff -p --exclude=Makefile.am --exclude=Makefile.in common/configparser.cc ../dune-common-1.1/common/configparser.cc
*** common/configparser.cc	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/configparser.cc	Thu Apr  3 03:59:02 2008
*************** string& ConfigParser::operator[] (const 
*** 182,188 ****
  	}
  }
  
! string ConfigParser::get(const string& key, string defaultValue)
  {
  	if (hasKey(key))
  		return (*this)[key];
--- 182,188 ----
  	}
  }
  
! string ConfigParser::get(const string& key, const string& defaultValue)
  {
  	if (hasKey(key))
  		return (*this)[key];
*************** string ConfigParser::get(const string& k
*** 190,203 ****
  		return defaultValue;
  }
  
! 
! string ConfigParser::get(const string& key, char* defaultValue)
  {
! 	string s = defaultValue;
! 	
! 	return get(key, s);
  }
  
  int ConfigParser::get(const string& key, int defaultValue)
  {
  	stringstream stream;
--- 190,204 ----
  		return defaultValue;
  }
  
! string ConfigParser::get(const string& key, const char* defaultValue)
  {
! 	if (hasKey(key))
! 		return (*this)[key];
! 	else
! 		return defaultValue;
  }
  
+ 
  int ConfigParser::get(const string& key, int defaultValue)
  {
  	stringstream stream;
*************** bool ConfigParser::get(const string& key
*** 229,244 ****
  	return (atoi(ret.c_str()) !=0 );
  }
  
  string ConfigParser::trim(string s)
  {
  	int i = 0;
! 	while (s[i] == ' ')
  		i++;
  	
  	s.erase(0,i);
  	
  	i = s.length();
! 	while (s[i-1] == ' ')
  		i--;
  	
  	s.erase(i);
--- 230,287 ----
  	return (atoi(ret.c_str()) !=0 );
  }
  
+ // This namespace here is needed to make the code compile...
+ namespace Dune {
+ 
+ template<>
+ string ConfigParser::get<string>(const string& key)
+ {
+ 	if (hasKey(key))
+ 		return (*this)[key];
+ 
+         DUNE_THROW(RangeError, "Key '" << key << "' not found in parameter file!");
+ }
+ 
+ template<>
+ int ConfigParser::get<int>(const string& key)
+ {
+         if (hasKey(key))
+             return std::atoi((*this)[key].c_str());
+ 
+         DUNE_THROW(RangeError, "Key '" << key << "' not found in parameter file!");
+ }
+ 
+ template<>
+ double ConfigParser::get<double>(const string& key)
+ {
+     if (hasKey(key))
+         return std::atof((*this)[key].c_str());
+ 
+     DUNE_THROW(RangeError, "Key '" << key << "' not found in parameter file!");
+ }
+ 
+ template<>
+ bool ConfigParser::get<bool>(const string& key)
+ {
+         if (hasKey(key))
+             return (std::atoi((*this)[key].c_str()) !=0 );
+ 
+         DUNE_THROW(RangeError, "Key '" << key << "' not found in parameter file!");
+ }
+ 
+ 
+ }  // end namespace Dune
+ 
  string ConfigParser::trim(string s)
  {
  	int i = 0;
! 	while ((s[i] == ' ') or (s[i] == '\n') or (s[i] == '\r'))
  		i++;
  	
  	s.erase(0,i);
  	
  	i = s.length();
! 	while ((s[i-1] == ' ') or (s[i-1] == '\n') or (s[i-1] == '\r'))
  		i--;
  	
  	s.erase(i);
diff -p --exclude=Makefile.am --exclude=Makefile.in common/configparser.hh ../dune-common-1.1/common/configparser.hh
*** common/configparser.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/configparser.hh	Thu Apr  3 03:59:02 2008
*************** namespace Dune {
*** 143,152 ****
  			 * \param defaultValue default if key does not exist
  			 * \return value as string
  			 */
! 			std::string get(const std::string& key, std::string defaultValue);
! 			
! 			
! 			std::string get(const std::string& key, char* defaultValue);
  			
  			
  			/** \brief get value as int
--- 143,161 ----
  			 * \param defaultValue default if key does not exist
  			 * \return value as string
  			 */
! 			std::string get(const std::string& key, const std::string& defaultValue);
! 
! 			/** \brief get value as string
! 			 * 
! 			 * Returns pure string value for given key.
! 			 * 
!                          * \todo This is a hack so get("my_key", "xyz") compiles
!                          * (without this method "xyz" resolves to bool instead of std::string)
! 			 * \param key key name
! 			 * \param defaultValue default if key does not exist
! 			 * \return value as string
! 			 */
! 			std::string get(const std::string& key, const char* defaultValue);
  			
  			
  			/** \brief get value as int
*************** namespace Dune {
*** 181,186 ****
--- 190,205 ----
  			 */
  			bool get(const std::string& key, bool defaultValue);
  			
+             /** \brief Get value
+              *
+              * \param T Type of the value
+              * \param key Key name
+              * \throws RangeError if key does not exist
+              * \throws NotImplemented Type is not supported
+              * \return value as T
+              */
+             template <class T>
+             T get(const std::string& key);
  			
  			/** \brief get value keys
  			 * 
diff -p --exclude=Makefile.am --exclude=Makefile.in common/dlist.hh ../dune-common-1.1/common/dlist.hh
*** common/dlist.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/dlist.hh	Thu Apr  3 03:59:02 2008
*************** namespace Dune {
*** 18,24 ****
    //! exception thrown on illegal element access
    class DoubleLinkedListError : public RangeError {};
  
!     /*! A doubly-linked list */
    template <class T> 
    class DoubleLinkedList {
    private:
--- 18,26 ----
    //! exception thrown on illegal element access
    class DoubleLinkedListError : public RangeError {};
  
!   /*! \brief (DEPRECATED) A doubly-linked list
!     \deprecated Please use std::list
!    */
    template <class T> 
    class DoubleLinkedList {
    private:
*************** namespace Dune {
*** 77,83 ****
          
  
              //! empty constructor
!         DoubleLinkedList();
  
              //! copy constructor
          DoubleLinkedList (const DoubleLinkedList<T>&);
--- 79,85 ----
          
  
              //! empty constructor
!         DoubleLinkedList() DUNE_DEPRECATED;
  
              //! copy constructor
          DoubleLinkedList (const DoubleLinkedList<T>&);
*************** namespace Dune {
*** 115,121 ****
          Iterator head;        // erstes Element der Liste
          Iterator tail;        // letztes Element der Liste
          int numelements;      // Anzahl Elemente in der Liste
!   } ;
  
  }
  
--- 117,123 ----
          Iterator head;        // erstes Element der Liste
          Iterator tail;        // letztes Element der Liste
          int numelements;      // Anzahl Elemente in der Liste
!   } DUNE_DEPRECATED;
  
  }
  
Only in ../dune-common-1.1/common/: exprtmpl
Only in ../dune-common-1.1/common/: exprtmpl.cc
Only in ../dune-common-1.1/common/: exprtmpl.hh
Only in ../dune-common-1.1/common/: fassign.hh
diff -p --exclude=Makefile.am --exclude=Makefile.in common/fixedarray.hh ../dune-common-1.1/common/fixedarray.hh
*** common/fixedarray.hh	Tue Jul 10 13:35:43 2007
--- ../dune-common-1.1/common/fixedarray.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,17 ****
  #ifndef DUNE_FIXEDARRAY_HH
  #define DUNE_FIXEDARRAY_HH
  
! 
! //***********************************************************************
! //
! //  implementation of peter array
! //
! //***********************************************************************
  
  #include<iostream>
  #include<iomanip>
  #include<string>
  
  namespace Dune 
  {
    /** @addtogroup Common
--- 1,26 ----
  #ifndef DUNE_FIXEDARRAY_HH
  #define DUNE_FIXEDARRAY_HH
  
! /** \file
!     \brief implementation of the stl array class (a static array)
!     and its deprecated ancestor FixedArray
! */
  
  #include<iostream>
  #include<iomanip>
  #include<string>
  
+ #include <dune/common/deprecated.hh>
+ 
+ // Include system implementation of array class if present
+ #ifdef HAVE_ARRAY
+ #include <array>
+ #endif
+ #ifdef HAVE_TR1_ARRAY
+ #include <tr1/array>
+ #endif
+ 
+ 
  namespace Dune 
  {
    /** @addtogroup Common
*************** namespace Dune 
*** 19,28 ****
--- 28,130 ----
    @{
    */
  
+ #ifdef HAVE_ARRAY
+     using std::array;
+ #elif defined HAVE_TR1_ARRAY
+     using std::tr1::array;
+ #else
+ 
    /** \brief Simple fixed size array class
     *
     */
    template<class T, int N>
+   class array {
+   public:
+ 
+       //! Remember the storage type 
+       typedef T 	    			      value_type;
+ 
+       /** \brief Reference to an object */
+       typedef value_type&                   	      reference;
+ 
+       /** \brief Const reference to an object */
+       typedef const value_type&             	      const_reference;
+ 
+       /** \brief Iterator type */
+       typedef value_type*          		      iterator;
+ 
+       /** \brief Const iterator type */
+       typedef const value_type*			      const_iterator;
+ 
+       /** \brief Type used for array indices */
+       typedef std::size_t                    	      size_type;
+ 
+       /** \brief Difference type */
+       typedef std::ptrdiff_t                   	      difference_type;
+ 
+       /** \brief Reverse iterator type */
+       typedef std::reverse_iterator<iterator>	      reverse_iterator;
+ 
+       /** \brief Const reverse iterator type */
+       typedef std::reverse_iterator<const_iterator>   const_reverse_iterator;
+ 
+       //! Create uninitialized array
+       array () {}
+       
+       /** \brief Initialize all components with same entry
+           \deprecated Deprecated because the stl implementation of array doesn't have it
+       */
+       array (const T& t) DUNE_DEPRECATED
+       {
+           for (int i=0; i<N; i++) a[i]=t;
+       }
+ 
+       /** \brief Return array size */
+       size_type size() const {return N;}
+ 
+       //! Assign value to all entries
+       array<T,N>& operator= (const T& t)
+       {
+           for (int i=0; i<N; i++) a[i]=t;
+           return (*this);
+       }
+         
+       //! \brief Assign value to all entries
+       void assign(const T& t)
+       {
+           for (int i=0; i<N; i++) a[i]=t;
+       }
+ 
+       //! Component access
+       reference operator[] (size_type i)
+       {
+           return a[i];
+       }
+ 
+       //! Const component access
+       const_reference operator[] (size_type i) const
+       {
+           return a[i];
+       }
+ 
+   protected:
+       T a[(N > 0) ? N : 1];
+   };
+ #endif
+     //! Output operator for array
+     template <class T, int N>
+     inline std::ostream& operator<< (std::ostream& s, array<T,N> e)
+     {
+         s << "[";
+         for (int i=0; i<N-1; i++) s << e[i] << ",";
+         s << e[N-1] << "]";
+         return s;
+     }
+ 
+   /** \brief Simple fixed size array class
+    *  \deprecated Replaced by array
+    */
+   template<class T, int N>
    class FixedArray {
    public:
  
*************** namespace Dune 
*** 40,46 ****
        FixedArray () {}
        
        //! Initialize all components with same size
!       FixedArray (T t)
        {
            for (int i=0; i<N; i++) a[i]=t;
        }
--- 142,148 ----
        FixedArray () {}
        
        //! Initialize all components with same size
!       FixedArray (T t) DUNE_DEPRECATED
        {
            for (int i=0; i<N; i++) a[i]=t;
        }
*************** namespace Dune 
*** 48,60 ****
        /** \brief Return array size */
        int size() const {return N;}
  
!       //! Assign value to all entries
!       FixedArray<T,N>& operator= (const T& t)
        {
!           for (int i=0; i<N; i++) a[i]=t;
            return (*this);
        }
!         
        //! Component access
        T& operator[] (int i)
        {
--- 150,170 ----
        /** \brief Return array size */
        int size() const {return N;}
  
!     /** \brief Assign value to all entries
!      * @deprecated Use assign instead.
!      */
!       FixedArray<T,N>& operator= (const T& t) DUNE_DEPRECATED
        {
!           assign(t);
            return (*this);
        }
! 
!     //! \brief Assign value to all entries
!     void assign(const T& t)
!     {
!       for (int i=0; i<N; i++) a[i]=t;
!     }
!     
        //! Component access
        T& operator[] (int i)
        {
*************** namespace Dune 
*** 88,94 ****
        
    protected:
        T a[n];
!   };
      
      //! Output operator for FixedArray
      template <class T, int N>
--- 198,204 ----
        
    protected:
        T a[n];
!   } DUNE_DEPRECATED;
      
      //! Output operator for FixedArray
      template <class T, int N>
diff -p --exclude=Makefile.am --exclude=Makefile.in common/fmatrix.hh ../dune-common-1.1/common/fmatrix.hh
*** common/fmatrix.hh	Tue Oct  9 16:57:23 2007
--- ../dune-common-1.1/common/fmatrix.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: fmatrix.hh 5004 2007-10-05 09:55:44Z christi $
  #ifndef DUNE_FMATRIX_HH
  #define DUNE_FMATRIX_HH
  
--- 1,4 ----
! // $Id: fmatrix.hh 5077 2008-02-06 14:05:09Z robertk $
  #ifndef DUNE_FMATRIX_HH
  #define DUNE_FMATRIX_HH
  
*************** namespace Dune {
*** 47,59 ****
  
    Matrices represent linear maps from a vector space V to a vector space W.
         This class represents such a linear map by storing a two-dimensional
!        array of numbers of a given field type K. The number of rows and
         columns is given at compile time.
- 
- 	   Implementation of all members uses template meta programs where appropriate
    */
    template<class K, int n, int m>
    class FieldMatrix
    {
    public:
  	// standard constructor and everything is sufficient ...
--- 47,62 ----
  
    Matrices represent linear maps from a vector space V to a vector space W.
         This class represents such a linear map by storing a two-dimensional
!        %array of numbers of a given field type K. The number of rows and
         columns is given at compile time.
    */
+ #ifdef DUNE_EXPRESSIONTEMPLATES
+   template<class K, int n, int m>
+   class FieldMatrix : ExprTmpl::Matrix< FieldMatrix<K,n,m> >
+ #else
    template<class K, int n, int m>
    class FieldMatrix
+ #endif
    {
    public:
  	// standard constructor and everything is sufficient ...
*************** namespace Dune {
*** 223,235 ****
  	//! vector space division by scalar
  	FieldMatrix& operator/= (const K& k)
  	{
!             for (int i=0; i<n; i++)
                  p[i] /= k;
  	  return *this;
  	}
  
  	//===== linear maps
     
  	//! y += A x
  	template<class X, class Y>
  	void umv (const X& x, Y& y) const
--- 226,254 ----
  	//! vector space division by scalar
  	FieldMatrix& operator/= (const K& k)
  	{
!             for (size_type i=0; i<n; i++)
                  p[i] /= k;
  	  return *this;
  	}
  
  	//===== linear maps
     
+ 	//! y = A x
+ 	template<class X, class Y>
+ 	void mv (const X& x, Y& y) const
+ 	{
+ #ifdef DUNE_FMatrix_WITH_CHECKING
+ 	  if (x.N()!=M()) DUNE_THROW(FMatrixError,"index out of range");
+ 	  if (y.N()!=N()) DUNE_THROW(FMatrixError,"index out of range");
+ #endif
+     for (size_type i=0; i<n; ++i)
+     {
+       y[i] = 0;
+       for (size_type j=0; j<m; j++)
+         y[i] += (*this)[i][j] * x[j];
+     }
+ 	}
+ 
  	//! y += A x
  	template<class X, class Y>
  	void umv (const X& x, Y& y) const
*************** namespace Dune {
*** 633,639 ****
--- 652,679 ----
              x[0] = detinv*(p[1][1]*b[0]-p[0][1]*b[1]);
              x[1] = detinv*(p[0][0]*b[1]-p[1][0]*b[0]);
  
+         } else if (n==3) {
+ 
+             K d = determinant();
+ #ifdef DUNE_FMatrix_WITH_CHECKING
+             if (fvmeta_absreal(d)<FMatrixPrecision<>::absolute_limit())
+                 DUNE_THROW(FMatrixError,"matrix is singular");
+ #endif
+ 
+             x[0] = (b[0]*p[1][1]*p[2][2] - b[0]*p[2][1]*p[1][2]
+                     - b[1] *p[0][1]*p[2][2] + b[1]*p[2][1]*p[0][2]
+                     + b[2] *p[0][1]*p[1][2] - b[2]*p[1][1]*p[0][2]) / d;
+ 
+             x[1] = (p[0][0]*b[1]*p[2][2] - p[0][0]*b[2]*p[1][2]
+                     - p[1][0] *b[0]*p[2][2] + p[1][0]*b[2]*p[0][2]
+                     + p[2][0] *b[0]*p[1][2] - p[2][0]*b[1]*p[0][2]) / d;
+ 
+             x[2] = (p[0][0]*p[1][1]*b[2] - p[0][0]*p[2][1]*b[1]
+                     - p[1][0] *p[0][1]*b[2] + p[1][0]*p[2][1]*b[0]
+                     + p[2][0] *p[0][1]*b[1] - p[2][0]*p[1][1]*b[0]) / d;
+ 
          } else {
+ 
  	  V& rhs = x; // use x to store rhs
  	  rhs = b; // copy data
  	  Elim<V> elim(rhs);
*************** namespace Dune {
*** 929,934 ****
--- 969,980 ----
  
  	//===== linear maps
     
+ 	//! y = A x
+ 	void mv (const FieldVector<K,1>& x, FieldVector<K,1>& y) const
+ 	{
+ 	  y.p = a[0] * x.p;
+ 	}
+ 
  	//! y += A x
  	void umv (const FieldVector<K,1>& x, FieldVector<K,1>& y) const
  	{
*************** static inline FieldVector<K,cols> multTr
*** 1305,1310 ****
--- 1351,1370 ----
  
  } // end namespace FMatrixHelp 
  
+ #ifdef DUNE_EXPRESSIONTEMPLATES
+ template <class K, int N, int M>
+ struct BlockType< FieldMatrix<K,N,M> >
+ {
+   typedef K type;
+ };
+ 
+ template <class K, int N, int M>
+ struct FieldType< FieldMatrix<K,N,M> >
+ {
+   typedef K type;
+ };
+ #endif // DUNE_EXPRESSIONTEMPLATES
+ 
    /** @} end documentation */
  
  } // end namespace
diff -p --exclude=Makefile.am --exclude=Makefile.in common/fvector.hh ../dune-common-1.1/common/fvector.hh
*** common/fvector.hh	Mon Jul 30 10:06:22 2007
--- ../dune-common-1.1/common/fvector.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: fvector.hh 4953 2007-07-12 14:58:01Z christi $
  #ifndef DUNE_FVECTOR_HH
  #define DUNE_FVECTOR_HH
  
--- 1,4 ----
! // $Id: fvector.hh 4929 2007-04-27 12:21:01Z christi $
  #ifndef DUNE_FVECTOR_HH
  #define DUNE_FVECTOR_HH
  
***************
*** 9,16 ****
--- 9,22 ----
  #include "exceptions.hh"
  #include "genericiterator.hh"
  
+ #ifdef DUNE_EXPRESSIONTEMPLATES
+ #include "exprtmpl.hh"
+ #endif
+ 
  namespace Dune {
  
+ #ifndef DUNE_EXPRESSIONTEMPLATES
+   
    /** @defgroup DenseMatVec Dense Matrix and Vector Template Library
        @ingroup Common
  	  @{
*************** representing a field and a compile-time 
*** 23,28 ****
--- 29,38 ----
  
    // forward declaration of template
    template<class K, int n> class FieldVector;
+ 
+ #endif
+   
+ #ifndef DUNE_EXPRESSIONTEMPLATES
    
    template<class K>
    inline double fvmeta_absreal (const K& k)
*************** representing a field and a compile-time 
*** 48,60 ****
  	return c.real()*c.real() + c.imag()*c.imag();
    }
  
    //! Iterator class for sequential access to FieldVector and FieldMatrix
    template<class C, class T>
    class FieldIterator : 
      public Dune::RandomAccessIteratorFacade<FieldIterator<C,T>,T, T&, int>
    {
!     friend class FieldIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >;
!     friend class FieldIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >;
      
    public:
      
--- 58,72 ----
  	return c.real()*c.real() + c.imag()*c.imag();
    }
  
+ #endif
+ 
    //! Iterator class for sequential access to FieldVector and FieldMatrix
    template<class C, class T>
    class FieldIterator : 
      public Dune::RandomAccessIteratorFacade<FieldIterator<C,T>,T, T&, int>
    {
!     friend class FieldIterator<typename remove_const<C>::type, typename remove_const<T>::type >;
!     friend class FieldIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >;
      
    public:
      
*************** representing a field and a compile-time 
*** 72,89 ****
        : container_(&cont), position_(pos)
        {}
      
!     FieldIterator(const FieldIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >& other)
        : container_(other.container_), position_(other.position_)
        {}
      
      // Methods needed by the forward iterator
!     bool equals(const FieldIterator<typename Dune::RemoveConst<C>::Type,typename Dune::RemoveConst<T>::Type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
      
      
!     bool equals(const FieldIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
--- 84,111 ----
        : container_(&cont), position_(pos)
        {}
      
!     FieldIterator(const FieldIterator<typename remove_const<C>::type, typename remove_const<T>::type >& other)
        : container_(other.container_), position_(other.position_)
        {}
      
+ #if 0    
+     FieldIterator(const FieldIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >& other)
+       : container_(other.container_), position_(other.position_)
+       {}
+ #endif
+ #if 0
+     FieldIterator(const FieldIterator<C,T>& other)
+       : container_(other.container_), position_(other.position_)
+       {}
+ #endif
      // Methods needed by the forward iterator
!     bool equals(const FieldIterator<typename remove_const<C>::type,typename remove_const<T>::type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
      
      
!     bool equals(const FieldIterator<const typename remove_const<C>::type,const typename remove_const<T>::type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
*************** representing a field and a compile-time 
*** 110,122 ****
        position_=position_+n;
      }
      
!     std::ptrdiff_t distanceTo(FieldIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type> other)const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
        }
      
!     std::ptrdiff_t distanceTo(FieldIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type> other)const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
--- 132,144 ----
        position_=position_+n;
      }
      
!     std::ptrdiff_t distanceTo(FieldIterator<const typename remove_const<C>::type,const typename remove_const<T>::type> other)const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
        }
      
!     std::ptrdiff_t distanceTo(FieldIterator<typename remove_const<C>::type, typename remove_const<T>::type> other)const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
*************** representing a field and a compile-time 
*** 146,151 ****
--- 168,290 ----
      typedef typename T::ConstIterator type;
    };
    
+ #ifdef DUNE_EXPRESSIONTEMPLATES
+   //! Iterator class for flat sequential access to a nested Vector
+   template<class V>
+   class FlatIterator :
+     public ForwardIteratorFacade<FlatIterator<V>,
+                                  typename Dune::FieldType<V>::type,
+                                  typename Dune::FieldType<V>::type&,
+                                  int>
+   {
+   public:
+     typedef typename IteratorType<V>::type BlockIterator;
+     typedef std::ptrdiff_t DifferenceType;
+ //    typedef typename BlockIterator::DifferenceType DifferenceType;
+     typedef typename BlockType<V>::type block_type;
+     typedef typename FieldType<V>::type field_type;
+     typedef FlatIterator<block_type> SubBlockIterator;
+     FlatIterator(const BlockIterator & i) :
+       it(i), bit(i->begin()), bend(i->end()) {};
+     void increment ()
+       {
+         ++bit;
+         if (bit == bend)
+         {
+           ++it;
+           bit = it->begin();
+           bend = it->end();
+         }
+       }
+     bool equals (const FlatIterator & fit) const
+       {
+         return fit.it == it && fit.bit == bit;
+       }
+     field_type& dereference() const
+       {
+         return *bit;
+       }
+     //! return index
+     DifferenceType index () const
+       {
+         return bit.index();
+       }
+   private:
+     BlockIterator it;
+     SubBlockIterator bit;
+     SubBlockIterator bend;
+   };
+ 
+   //! Specialization for FieldVector
+   //! acts as the end of the recursive template
+   template<class K, int N>
+   class FlatIterator< FieldVector<K,N> > :
+     public ForwardIteratorFacade<FlatIterator< FieldVector<K,N> >,
+                                  K, K&, int>
+   {
+   public:
+     typedef typename FieldVector<K,N>::Iterator BlockIterator;
+     typedef std::ptrdiff_t DifferenceType;
+ //    typedef typename BlockIterator::DifferenceType DifferenceType;
+     typedef typename FieldVector<K,N>::field_type field_type;
+     FlatIterator(const BlockIterator & i) : it(i) {};
+     void increment ()
+       {
+         ++it;
+       }
+     bool equals (const FlatIterator & fit) const
+       {
+         return fit.it == it;
+       }
+     field_type& dereference() const
+       {
+         return *it;
+       }
+     //! return index
+     DifferenceType index () const
+       {
+         return it.index();
+       }
+   private:
+     BlockIterator it;
+   };
+ 
+   //! Specialization for const FieldVector
+   //! acts as the end of the recursive template
+   template<class K, int N>
+   class FlatIterator< const FieldVector<K,N> > :
+     public ForwardIteratorFacade<FlatIterator< const FieldVector<K,N> >,
+                                  const K, const K&, int>
+   {
+   public:
+     typedef typename FieldVector<K,N>::ConstIterator BlockIterator;
+     typedef std::ptrdiff_t DifferenceType;
+ //    typedef typename BlockIterator::DifferenceType DifferenceType;
+     typedef typename FieldVector<K,N>::field_type field_type;
+     FlatIterator(const BlockIterator & i) : it(i) {};
+     void increment ()
+       {
+         ++it;
+       }
+     bool equals (const FlatIterator & fit) const
+       {
+         return fit.it == it;
+       }
+     const field_type& dereference() const
+       {
+         return *it;
+       }
+     //! return index
+     DifferenceType index () const
+       {
+         return it.index();
+       }
+   private:
+     BlockIterator it;
+   };
+ #endif
+ 
+ #ifdef DUNE_EXPRESSIONTEMPLATES
    /** \brief Construct a vector space out of a tensor product of fields.
  
  	 K is the field type (use float, double, complex, etc) and n 
*************** representing a field and a compile-time 
*** 157,162 ****
--- 296,315 ----
    */
    template<class K, int SIZE>
    class FieldVector
+     : public Dune::ExprTmpl::Vector< FieldVector<K,SIZE> >
+ #else
+   /** \brief Construct a vector space out of a tensor product of fields.
+ 
+ 	 K is the field type (use float, double, complex, etc) and n 
+ 	 is the number of components.
+ 
+ 	 It is generally assumed that K is a numerical type compatible with double
+ 	 (E.g. norms are always computed in double precision).
+ 
+   */
+   template<class K, int SIZE>
+   class FieldVector
+ #endif
    {
    public:
  	// remember size of vector 
*************** representing a field and a compile-time 
*** 190,195 ****
--- 343,349 ----
  	//! Constructor making uninitialized vector
  	FieldVector() {}
  
+ #ifndef DUNE_EXPRESSIONTEMPLATES
  	//! Constructor making vector with identical coordinates
  	explicit FieldVector (const K& t)
  	{
*************** representing a field and a compile-time 
*** 206,211 ****
--- 360,412 ----
  	  return *this;   
  	}
  
+ #else
+ 	//! Constructor making vector with identical coordinates
+ 	explicit FieldVector (const K& t)
+ 	{
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector Copy Constructor Scalar\n";
+ #endif
+       assignFrom(t);
+ 	}
+     //! Assignment operator for scalar
+ 	FieldVector& operator= (const K& k)
+ 	{
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector Assignment Operator Scalar\n";
+ #endif
+       return assignFrom(k);
+ 	}
+     template <class E>
+     FieldVector (Dune::ExprTmpl::Expression<E> op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector Copy Constructor Expression\n";
+ #endif
+       assignFrom(op);
+     }
+     template <class V>
+     FieldVector (const Dune::ExprTmpl::Vector<V> & op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector Copy Operator Vector\n";
+ #endif
+       assignFrom(op);
+     }
+     template <class E>
+     FieldVector&  operator = (Dune::ExprTmpl::Expression<E> op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector Assignment Operator Expression\n";
+ #endif
+       return assignFrom(op);
+     }
+     template <class V>
+     FieldVector& operator = (const Dune::ExprTmpl::Vector<V> & op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector Assignment Operator Vector\n";
+ #endif
+       return assignFrom(op);
+     }
+ #endif
+ 
  	//===== access to components
  
  	//! random access 
*************** representing a field and a compile-time 
*** 302,307 ****
--- 503,509 ----
  		return ConstIterator(*this,SIZE);
  	}
      
+ #ifndef DUNE_EXPRESSIONTEMPLATES
  	//===== vector space arithmetic
  
  	//! vector space addition
*************** representing a field and a compile-time 
*** 366,371 ****
--- 568,575 ----
  	  return *this;
  	}
  
+ #endif
+ 
  	//! Binary vector comparison
  	bool operator== (const FieldVector& y) const
  	{
*************** representing a field and a compile-time 
*** 379,389 ****
--- 583,598 ----
  	//! vector space axpy operation
  	FieldVector& axpy (const K& a, const FieldVector& y)
  	{
+ #ifndef DUNE_EXPRESSIONTEMPLATES
              for (size_type i=0; i<SIZE; i++)
                  p[i] += a*y.p[i];
+ #else
+       *this += a*y;
+ #endif
  	  return *this;
  	}
  
+ #ifndef DUNE_EXPRESSIONTEMPLATES
  	//===== Euclidean scalar product
  
  	//! scalar product
*************** representing a field and a compile-time 
*** 451,456 ****
--- 660,666 ----
                  result = std::max(result, fvmeta_absreal(p[i]));
              return result;
  	}
+ #endif
  
  	//===== sizes
  
*************** representing a field and a compile-time 
*** 484,493 ****
--- 694,711 ----
    // forward declarations
    template<class K, int n, int m> class FieldMatrix;
  
+ #ifdef DUNE_EXPRESSIONTEMPLATES
    /**! Vectors containing only one component
     */
    template<class K>
    class FieldVector<K,1>
+     : public Dune::ExprTmpl::Vector< FieldVector<K,1> >
+ #else
+   /**! Vectors containing only one component
+    */
+   template<class K>
+   class FieldVector<K,1>
+ #endif
    {
      enum { n = 1 };
    public:
*************** representing a field and a compile-time 
*** 532,537 ****
--- 750,786 ----
  	  return *this;   
  	}
  
+ #ifdef DUNE_EXPRESSIONTEMPLATES
+     template <class E>
+     FieldVector (Dune::ExprTmpl::Expression<E> op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector<1> Copy Constructor Expression\n";
+ #endif
+       assignFrom(op);
+     }
+     template <class V>
+     FieldVector (const Dune::ExprTmpl::Vector<V> & op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector<1> Copy Operator Vector\n";
+ #endif
+       assignFrom(op);
+     }
+     template <class E>
+     FieldVector&  operator = (Dune::ExprTmpl::Expression<E> op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector<1> Assignment Operator Expression\n";
+ #endif
+       return assignFrom(op);
+     }
+     template <class V>
+     FieldVector& operator = (const Dune::ExprTmpl::Vector<V> & op) {
+ #ifdef DUNE_VVERBOSE
+       Dune::dvverb << INDENT << "FieldVector<1> Assignment Operator Vector\n";
+ #endif
+       return assignFrom(op);
+     }
+ #endif
+ 
  	//===== access to components
  
  	//! random access 
*************** representing a field and a compile-time 
*** 744,749 ****
--- 993,999 ----
  	K p; 
    };
  
+ #ifndef DUNE_EXPRESSIONTEMPLATES
    //! Binary vector addition
    template<class K>
    inline FieldVector<K,1> operator+ (const FieldVector<K,1>& a, const FieldVector<K,1>& b)
*************** representing a field and a compile-time 
*** 791,796 ****
--- 1041,1048 ----
      FieldVector<K,1> z = a;
      return (z[0]-=b);
    }
+ #endif
+ 
  
    /** @} end documentation */
  
diff -p --exclude=Makefile.am --exclude=Makefile.in common/genericiterator.hh ../dune-common-1.1/common/genericiterator.hh
*** common/genericiterator.hh	Fri Apr 20 14:42:50 2007
--- ../dune-common-1.1/common/genericiterator.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: genericiterator.hh 4915 2007-04-20 12:42:46Z mblatt $
  #ifndef DUNE_GENERICITERATOR_HH
  #define DUNE_GENERICITERATOR_HH
  
--- 1,4 ----
! // $Id: genericiterator.hh 4914 2007-04-20 12:36:05Z mblatt $
  #ifndef DUNE_GENERICITERATOR_HH
  #define DUNE_GENERICITERATOR_HH
  
*************** template<class C, class T, class D = std
*** 89,96 ****
  class GenericIterator : 
  public Dune::RandomAccessIteratorFacade<GenericIterator<C,T>,T, T&, D>
  {
!   friend class GenericIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >;
!   friend class GenericIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >;
  
  public:
  
--- 89,96 ----
  class GenericIterator : 
  public Dune::RandomAccessIteratorFacade<GenericIterator<C,T>,T, T&, D>
  {
!   friend class GenericIterator<typename remove_const<C>::type, typename remove_const<T>::type >;
!   friend class GenericIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >;
  
  public:
  
*************** public:
*** 138,144 ****
     * 1. if we are mutable this is the only valid copy constructor, as the arguments is a mutable iterator
     * 2. if we are a const iterator the argument is a mutable iterator => This is the needed conversion to initialize a const iterator form a mutable one.
     */
!   GenericIterator(const GenericIterator<typename Dune::RemoveConst<Container>::Type, typename Dune::RemoveConst<T>::Type,D >& other): container_(other.container_), position_(other.position_)
    {}
  
    /**
--- 138,144 ----
     * 1. if we are mutable this is the only valid copy constructor, as the arguments is a mutable iterator
     * 2. if we are a const iterator the argument is a mutable iterator => This is the needed conversion to initialize a const iterator form a mutable one.
     */
!   GenericIterator(const GenericIterator<typename remove_const<Container>::type, typename remove_const<T>::type,D >& other): container_(other.container_), position_(other.position_)
    {}
  
    /**
*************** public:
*** 150,166 ****
     * 1. if we are mutable the arguments is a const iterator and therefore calling this method is mistake in the users code and results in a (probably not understandable compiler error
     * 2. If we are a const iterator this is the default copy constructor as the argument is a const iterator too.
     */
!   GenericIterator(const GenericIterator<const typename Dune::RemoveConst<Container>::Type, const typename Dune::RemoveConst<T>::Type,D >& other): container_(other.container_), position_(other.position_)
    {}
  
    // Methods needed by the forward iterator
!   bool equals(const GenericIterator<typename Dune::RemoveConst<Container>::Type,typename Dune::RemoveConst<T>::Type,D>& other) const
    {
      return position_ == other.position_ && container_ == other.container_;
    }
  
    
!   bool equals(const GenericIterator<const typename Dune::RemoveConst<Container>::Type,const typename Dune::RemoveConst<T>::Type,D>& other) const
    {
      return position_ == other.position_ && container_ == other.container_;
    }
--- 150,166 ----
     * 1. if we are mutable the arguments is a const iterator and therefore calling this method is mistake in the users code and results in a (probably not understandable compiler error
     * 2. If we are a const iterator this is the default copy constructor as the argument is a const iterator too.
     */
!   GenericIterator(const GenericIterator<const typename remove_const<Container>::type, const typename remove_const<T>::type, D >& other): container_(other.container_), position_(other.position_)
    {}
  
    // Methods needed by the forward iterator
!   bool equals(const GenericIterator<typename remove_const<Container>::type,typename remove_const<T>::type,D>& other) const
    {
      return position_ == other.position_ && container_ == other.container_;
    }
  
    
!   bool equals(const GenericIterator<const typename remove_const<Container>::type,const typename remove_const<T>::type,D>& other) const
    {
      return position_ == other.position_ && container_ == other.container_;
    }
*************** public:
*** 187,199 ****
      position_=position_+n;
    }
  
!   std::ptrdiff_t distanceTo(GenericIterator<const typename Dune::RemoveConst<Container>::Type,const typename Dune::RemoveConst<T>::Type,D> other)const
    {
      assert(other.container_==container_);
      return other.position_ - position_;
    }
  
!   std::ptrdiff_t distanceTo(GenericIterator<typename Dune::RemoveConst<Container>::Type, typename Dune::RemoveConst<T>::Type,D> other)const
    {
      assert(other.container_==container_);
      return other.position_ - position_;
--- 187,199 ----
      position_=position_+n;
    }
  
!   std::ptrdiff_t distanceTo(GenericIterator<const typename remove_const<Container>::type,const typename remove_const<T>::type,D> other)const
    {
      assert(other.container_==container_);
      return other.position_ - position_;
    }
  
!   std::ptrdiff_t distanceTo(GenericIterator<typename remove_const<Container>::type, typename remove_const<T>::type,D> other)const
    {
      assert(other.container_==container_);
      return other.position_ - position_;
diff -p --exclude=Makefile.am --exclude=Makefile.in common/helpertemplates.hh ../dune-common-1.1/common/helpertemplates.hh
*** common/helpertemplates.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/helpertemplates.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: helpertemplates.hh 4722 2006-10-13 08:59:35Z oliver $
  
  #ifndef DUNE_COMMON_HELPERTEMPLATES
  #define DUNE_COMMON_HELPERTEMPLATES
--- 1,4 ----
! // $Id: helpertemplates.hh 5038 2008-01-06 00:59:04Z christi $
  
  #ifndef DUNE_COMMON_HELPERTEMPLATES
  #define DUNE_COMMON_HELPERTEMPLATES
*************** template<class T1, class T2, class T3 = 
*** 39,71 ****
      Can_multiply() { void(*p)(T1,T2,T3) = constraints; }
  };
  
! /** 
!     \brief Helper template so that compilation fails if condition is not true.
!     
!     If the condition is true a static function yes is available, othewise the
!     only function available is no().
! 
!     Example for compile time check whether two types are the same:
!     \code
!     IsTrue<SameType<int,int>::value>::yes(); // 
!     IsTrue<SameType<bool,int>::value>::yes(); // false, will trigger a compile time error
!     \endcode
!     
!     A test that trigger a compile time error if condition is true:
!     \code
!     IsTrue<condition>::no()
!     \endcode
! */
! template <bool condition>
! struct IsTrue
! {
!   static void no() {};
! };
! 
! template <>
! struct IsTrue<true>
! {
!   static void yes() {};
! };
  
  #endif
--- 39,44 ----
      Can_multiply() { void(*p)(T1,T2,T3) = constraints; }
  };
  
! #include "static_assert.hh"
  
  #endif
diff -p --exclude=Makefile.am --exclude=Makefile.in common/iteratorfacades.hh ../dune-common-1.1/common/iteratorfacades.hh
*** common/iteratorfacades.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/iteratorfacades.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: iteratorfacades.hh 4734 2006-10-16 17:57:49Z oliver $
  #ifndef DUNE_ITERATORFACADES_HH
  #define DUNE_ITERATORFACADES_HH
  #include<iterator>
--- 1,4 ----
! // $Id: iteratorfacades.hh 4931 2007-05-01 10:49:22Z mblatt $
  #ifndef DUNE_ITERATORFACADES_HH
  #define DUNE_ITERATORFACADES_HH
  #include<iterator>
*************** namespace Dune
*** 26,33 ****
      template<class C, class T>
      class TestIterator : public Dune::BidirectionalIteratorFacade<TestIterator<C,T>,T, T&, int>
      {
!       friend class TestIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >;
!       friend class TestIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >;
      
      public:
      
--- 26,33 ----
      template<class C, class T>
      class TestIterator : public Dune::BidirectionalIteratorFacade<TestIterator<C,T>,T, T&, int>
      {
!       friend class TestIterator<typename remove_const<C>::type, typename remove_const<T>::type >;
!       friend class TestIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >;
      
      public:
      
*************** namespace Dune
*** 39,61 ****
          : container_(&cont), position_(pos)
        {}
  
!       TestIterator(const TestIterator<typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type >& other)
          : container_(other.container_), position_(other.position_)
        {}
      
      
!       TestIterator(const TestIterator<const typename Dune::RemoveConst<C>::Type, const typename Dune::RemoveConst<T>::Type >& other)
          : container_(other.container_), position_(other.position_)
        {}
      
        // Methods needed by the forward iterator
!       bool equals(const TestIterator<typename Dune::RemoveConst<C>::Type,typename Dune::RemoveConst<T>::Type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
      
      
!       bool equals(const TestIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
--- 39,61 ----
          : container_(&cont), position_(pos)
        {}
  
!       TestIterator(const TestIterator<typename remove_const<C>::type, typename remove_const<T>::type >& other)
          : container_(other.container_), position_(other.position_)
        {}
      
      
!       TestIterator(const TestIterator<const typename remove_const<C>::type, const typename remove_const<T>::type >& other)
          : container_(other.container_), position_(other.position_)
        {}
      
        // Methods needed by the forward iterator
!       bool equals(const TestIterator<typename remove_const<C>::type,typename remove_const<T>::type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
      
      
!       bool equals(const TestIterator<const typename remove_const<C>::type,const typename remove_const<T>::type>& other) const
        {
          return position_ == other.position_ && container_ == other.container_;
        }
*************** namespace Dune
*** 87,99 ****
          position_=position_+n;
        }
  
!       std::ptrdiff_t distanceTo(TestIterator<const typename Dune::RemoveConst<C>::Type,const typename Dune::RemoveConst<T>::Type> other) const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
        }
        
!       std::ptrdiff_t distanceTo(TestIterator<const typename Dune::RemoveConst<C>::Type, typename Dune::RemoveConst<T>::Type> other) const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
--- 87,99 ----
          position_=position_+n;
        }
  
!       std::ptrdiff_t distanceTo(TestIterator<const typename remove_const<C>::type,const typename remove_const<T>::type> other) const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
        }
        
!       std::ptrdiff_t distanceTo(TestIterator<const typename remove_const<C>::type, typename remove_const<T>::type> other) const
        {
          assert(other.container_==container_);
          return other.position_ - position_;
*************** namespace Dune
*** 129,135 ****
    template<class T, class V, class R = V&, class D = std::ptrdiff_t>
    class ForwardIteratorFacade :
      public std::iterator< std::forward_iterator_tag, 
! 			  typename RemoveConst<V>::Type, // std::iterator needs mutable value type 
  			  D,
  			  V*,
  			  R>
--- 129,135 ----
    template<class T, class V, class R = V&, class D = std::ptrdiff_t>
    class ForwardIteratorFacade :
      public std::iterator< std::forward_iterator_tag, 
! 			  typename remove_const<V>::type, // std::iterator needs mutable value type 
  			  D,
  			  V*,
  			  R>
*************** namespace Dune
*** 142,148 ****
       * The iterator has to define following 
       * functions have to be present:
       *
!      * <pre>
       *
       * // Access the value referred to.
       * Reference dereference() const;
--- 142,148 ----
       * The iterator has to define following 
       * functions have to be present:
       *
!      * \code
       *
       * // Access the value referred to.
       * Reference dereference() const;
*************** namespace Dune
*** 152,158 ****
       *
       * // position the iterator at the next element.
       * void increment()
!      * </pre>
       *
       * For an elaborate explanation see the
       * <A HREF="http://www.sgi.com/tech/stl/iterator_traits.html">STL Documentation</A>!
--- 152,158 ----
       *
       * // position the iterator at the next element.
       * void increment()
!      * \endcode
       *
       * For an elaborate explanation see the
       * <A HREF="http://www.sgi.com/tech/stl/iterator_traits.html">STL Documentation</A>!
*************** namespace Dune
*** 257,263 ****
    template<class T, class V, class R = V&, class D = std::ptrdiff_t>
    class BidirectionalIteratorFacade :
      public std::iterator< std::bidirectional_iterator_tag, 
! 			  typename RemoveConst<V>::Type, // std::iterator needs mutable value type 
  			  D,
  			  V*,
  			  R>
--- 257,263 ----
    template<class T, class V, class R = V&, class D = std::ptrdiff_t>
    class BidirectionalIteratorFacade :
      public std::iterator< std::bidirectional_iterator_tag, 
! 			  typename remove_const<V>::type, // std::iterator needs mutable value type 
  			  D,
  			  V*,
  			  R>
*************** namespace Dune
*** 270,276 ****
       * The iterator has to define following 
       * functions have to be present:
       *
!      * <pre>
       *
       * // Access the value referred to.
       * Reference dereference() const;
--- 270,276 ----
       * The iterator has to define following 
       * functions have to be present:
       *
!      * \code
       *
       * // Access the value referred to.
       * Reference dereference() const;
*************** namespace Dune
*** 284,290 ****
       * // position the iterator at the previous element.
       * void decrement()
       *
!      * </pre>
       *
       * For an elaborate explanation see the
       * <A HREF="http://www.sgi.com/tech/stl/iterator_traits.html">STL Documentation</A>
--- 284,290 ----
       * // position the iterator at the previous element.
       * void decrement()
       *
!      * \endcode
       *
       * For an elaborate explanation see the
       * <A HREF="http://www.sgi.com/tech/stl/iterator_traits.html">STL Documentation</A>
*************** namespace Dune
*** 405,411 ****
    template<class T, class V, class R = V&, class D = std::ptrdiff_t>
    class RandomAccessIteratorFacade :
      public std::iterator< std::random_access_iterator_tag, 
! 			  typename RemoveConst<V>::Type, // std::iterator needs mutable value type 
  			  D,
  			  V*,
  			  R>
--- 405,411 ----
    template<class T, class V, class R = V&, class D = std::ptrdiff_t>
    class RandomAccessIteratorFacade :
      public std::iterator< std::random_access_iterator_tag, 
! 			  typename remove_const<V>::type, // std::iterator needs mutable value type 
  			  D,
  			  V*,
  			  R>
*************** namespace Dune
*** 418,424 ****
       * The iterator has to define following 
       * functions have to be present:
       *
!      * <pre>
       *
       * // Access the value referred to.
       * Reference dereference() const;
--- 418,424 ----
       * The iterator has to define following 
       * functions have to be present:
       *
!      * \code
       *
       * // Access the value referred to.
       * Reference dereference() const;
*************** namespace Dune
*** 438,444 ****
       * // One should incorporate an assertion wether
       * // the same containers are referenced
       * DifferenceType distanceTo(j) const;
!      * </pre>
       *
       * For an elaborate explanation see the
       * <A HREF="http://www.sgi.com/tech/stl/iterator_traits.html">STL Documentation</A>
--- 438,444 ----
       * // One should incorporate an assertion wether
       * // the same containers are referenced
       * DifferenceType distanceTo(j) const;
!      * \endcode
       *
       * For an elaborate explanation see the
       * <A HREF="http://www.sgi.com/tech/stl/iterator_traits.html">STL Documentation</A>
Only in ../dune-common-1.1/common/: lru.hh
diff -p --exclude=Makefile.am --exclude=Makefile.in common/sllist.hh ../dune-common-1.1/common/sllist.hh
*** common/sllist.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/sllist.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: sllist.hh 4686 2006-08-08 14:38:24Z oliver $
  #ifndef DUNE__SLLIST_HH
  #define DUNE__SLLIST_HH
  
--- 1,4 ----
! // $Id: sllist.hh 5063 2008-01-24 11:18:42Z mblatt $
  #ifndef DUNE__SLLIST_HH
  #define DUNE__SLLIST_HH
  
*************** namespace Dune
*** 99,104 ****
--- 99,110 ----
       */
      typedef SLListModifyIterator<T,A> ModifyIterator;
      
+     /**
+      * @brief Assignment operator.
+      */
+     SLList<T,A>& operator=(const SLList<T,A>& other);
+     
+     
      /** 
       * @brief Add a new entry to the end of the list.
       * @param item The item to add.
*************** namespace Dune
*** 203,219 ****
        
      };
  
-     template<typename T1, typename A1>
-     SLList<T,A>& operator=(SLList<T1,A1>& other)
-     {
-       return *this;
-     }
-     
-     SLList<T,A>& operator=(SLList<T,A>& other)
-     {
-       return *this;
-     }
- 
      /**
       * @brief Delete the next element in the list.
       * @param current Element whose next element should be deleted.
--- 209,214 ----
*************** namespace Dune
*** 224,231 ****
       * @brief Copy the elements from another list.
       * @param other The other list.
       */
!     template<class T1, class A1>
!     void copyElements(const SLList<T1,A1>& other);
      
      /**
       * @brief Delete the next element in the list.
--- 219,225 ----
       * @brief Copy the elements from another list.
       * @param other The other list.
       */
!     void copyElements(const SLList<T,A>& other);
      
      /**
       * @brief Delete the next element in the list.
*************** namespace Dune
*** 596,603 ****
    }
  
    template<typename T, typename A>
!   template<typename T1, class A1>
!   void SLList<T,A>::copyElements(const SLList<T1,A1>& other)
    {
      assert(tail_==&beforeHead_);
      assert(size_==0);
--- 590,596 ----
    }
  
    template<typename T, typename A>
!   void SLList<T,A>::copyElements(const SLList<T,A>& other)
    {
      assert(tail_==&beforeHead_);
      assert(size_==0);
*************** namespace Dune
*** 614,619 ****
--- 607,620 ----
    {
      clear();
    }
+ 
+   template<typename T, class A>
+   SLList<T,A>& SLList<T,A>::operator=(const SLList<T,A>& other)
+   {
+     clear();
+     copyElements(other);
+     return *this;
+   }
    
    template<typename T, class A>
    inline void SLList<T,A>::push_back(const T& item)
*************** namespace Dune
*** 719,727 ****
        this->template deleteNext<false>(&beforeHead_);
      }
  
- #ifdef NDEBUG
-     size_=0;
- #endif
      assert(size_==0);
      // update the tail!
      tail_ = &beforeHead_;
--- 720,725 ----
Only in ../dune-common-1.1/common/: static_assert.hh
diff -p --exclude=Makefile.am --exclude=Makefile.in common/stdstreams.hh ../dune-common-1.1/common/stdstreams.hh
*** common/stdstreams.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/stdstreams.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: stdstreams.hh 4676 2006-08-04 11:11:58Z christi $
  
  /*
  
--- 1,4 ----
! // $Id: stdstreams.hh 5009 2007-10-30 17:21:11Z christi $
  
  /*
  
*************** namespace Dune {
*** 63,68 ****
--- 63,71 ----
     * If the  level of a stream is bigger than this value
     * it will be activated.
     */
+   #ifndef DUNE_MINIMAL_DEBUG_LEVEL
+   #define DUNE_MINIMAL_DEBUG_LEVEL 4
+   #endif
    static const DebugLevel MINIMAL_DEBUG_LEVEL = DUNE_MINIMAL_DEBUG_LEVEL;
  
    /** 
Common subdirectories: common/test and ../dune-common-1.1/common/test
Only in common/: tripel.hh
diff -p --exclude=Makefile.am --exclude=Makefile.in common/tuples.hh ../dune-common-1.1/common/tuples.hh
*** common/tuples.hh	Mon Apr 16 13:39:15 2007
--- ../dune-common-1.1/common/tuples.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,4 ****
! // $Id: tuples.hh 4897 2007-04-10 12:13:22Z sander $
  #ifndef DUNE_TUPLES_HH
  #define DUNE_TUPLES_HH
  
--- 1,4 ----
! // $Id: tuples.hh 5002 2007-10-04 09:56:37Z mblatt $
  #ifndef DUNE_TUPLES_HH
  #define DUNE_TUPLES_HH
  
***************
*** 6,13 ****
  #include"typetraits.hh"
  #include"helpertemplates.hh"
  
! namespace Dune 
! {
    /** @addtogroup Common
     *
     * @{
--- 6,19 ----
  #include"typetraits.hh"
  #include"helpertemplates.hh"
  
! #ifdef HAVE_TUPLE
! #include <tuple>
! #endif
! #ifdef HAVE_TR1_TUPLE
! #include <tr1/tuple>
! #endif
! 
! namespace Dune{
    /** @addtogroup Common
     *
     * @{
*************** namespace Dune 
*** 25,43 ****
     * @author Markus Blatt
     */
  
-   /**
-    * @brief An empty class.
-    */
-   struct Nil
-   {};
- 
-   namespace
-   {
-     inline const Nil nullType()
-     {
-       return Nil();
-     }
-   }
    
    template<class T>
    struct TupleAccessTraits
--- 31,36 ----
*************** namespace Dune 
*** 62,68 ****
      typedef T& NonConstType;
      typedef T& ParameterType;
    };
!   
    /**
     * @brief A tuple consisting of two objects.
     *
--- 55,80 ----
      typedef T& NonConstType;
      typedef T& ParameterType;
    };
! 
! #ifdef HAVE_TUPLE
!   using std::tuple;
! #elif defined HAVE_TR1_TUPLE
!   using std::tr1::tuple;
! #else
!   /**
!    * @brief An empty class.
!    */
!   struct Nil
!   {};
! 
!   namespace
!   {
!     inline const Nil nullType()
!     {
!       return Nil();
!     }
!   }
! 
    /**
     * @brief A tuple consisting of two objects.
     *
*************** namespace Dune 
*** 257,298 ****
     *
     * Use the following construction to access the individual elements.
     \code
!       Tuple<std::string, float*, int> my_tuple;
  
!       std:string& s = Element<0>::get(my_tuple);
!       float*      p = Element<1>::get(my_tuple);
  
        // Access the third element in a generic way
!       typedef ElementType<2, Tuple<std::string, float*, int> >::Type Type;
!       Type&       i = Element<2>::get(my_tuple);
     \endcode
     */
    template<typename T1, typename T2 = Nil, typename T3 = Nil, 
  	   typename T4 = Nil, typename T5 = Nil,typename T6 = Nil, 
  	   typename T7 = Nil, typename T8 = Nil, typename T9 = Nil>
!   class Tuple : public TupleToPairs<T1,T2,T3,T4,T5,T6,T7,T8,T9>::Type
    {
    public:
      //! Type of the first Pair defining the Tuple
      typedef typename TupleToPairs<T1,T2,T3,T4,T5,T6,T7,T8,T9>::Type FirstPair;
  
!     Tuple()
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1)
        : FirstPair(t1, nullType(), nullType(), nullType(), 
  		  nullType(), nullType(), nullType(), nullType(), 
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
  	  typename TupleAccessTraits<T2>::ParameterType t2)
        : FirstPair(t1, t2, nullType(), nullType(), 
  		  nullType(), nullType(), nullType(), nullType(), 
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3)
        : FirstPair(t1, t2, t3, nullType(), 
--- 269,310 ----
     *
     * Use the following construction to access the individual elements.
     \code
!       tuple<std::string, float*, int> my_tuple;
  
!       std:string& s = get<0>(my_tuple);
!       float*      p = get<1>(my_tuple);
  
        // Access the third element in a generic way
!       typedef tuple_element<2, tuple<std::string, float*, int> >::type Type;
!       Type&       i = get<2>(my_tuple);
     \endcode
     */
    template<typename T1, typename T2 = Nil, typename T3 = Nil, 
  	   typename T4 = Nil, typename T5 = Nil,typename T6 = Nil, 
  	   typename T7 = Nil, typename T8 = Nil, typename T9 = Nil>
!   class tuple : public TupleToPairs<T1,T2,T3,T4,T5,T6,T7,T8,T9>::Type
    {
    public:
      //! Type of the first Pair defining the Tuple
      typedef typename TupleToPairs<T1,T2,T3,T4,T5,T6,T7,T8,T9>::Type FirstPair;
  
!     tuple()
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1)
        : FirstPair(t1, nullType(), nullType(), nullType(), 
  		  nullType(), nullType(), nullType(), nullType(), 
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
  	  typename TupleAccessTraits<T2>::ParameterType t2)
        : FirstPair(t1, t2, nullType(), nullType(), 
  		  nullType(), nullType(), nullType(), nullType(), 
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3)
        : FirstPair(t1, t2, t3, nullType(), 
*************** namespace Dune 
*** 300,306 ****
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4)
--- 312,318 ----
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4)
*************** namespace Dune 
*** 309,315 ****
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
--- 321,327 ----
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
*************** namespace Dune 
*** 319,325 ****
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
--- 331,337 ----
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
*************** namespace Dune 
*** 330,336 ****
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
--- 342,348 ----
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
*************** namespace Dune 
*** 342,348 ****
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
--- 354,360 ----
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
*************** namespace Dune 
*** 355,361 ****
  		  nullType())
      {}
  
!     Tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
--- 367,373 ----
  		  nullType())
      {}
  
!     tuple(typename TupleAccessTraits<T1>::ParameterType t1,
            typename TupleAccessTraits<T2>::ParameterType t2,
            typename TupleAccessTraits<T3>::ParameterType t3,
            typename TupleAccessTraits<T4>::ParameterType t4,
*************** namespace Dune 
*** 368,408 ****
      {}
  
      template<class U1, class U2>
!     Tuple& operator=(const Pair<U1,U2>& other)
      {
        FirstPair::operator=(other);
        return *this;
      }
    };
  
    /**
     * @brief Get the type of the N-th element of the tuple.
     */
    template<int N, class Tuple>
!   struct ElementType;
    
    template<int N, typename T1, typename T2>
!   struct ElementType<N,Pair<T1,T2> >
    {
      /**
       * @brief The type of the N-th element of the tuple.
       */
!     typedef typename ElementType<N-1,T2>::Type Type;
    };
    
    /**
     * @brief Get the type of the first element of the tuple.
     */
    template<typename T1, typename T2>
!   struct ElementType<0, Pair<T1,T2> >
    {
      /**
       * @brief The type of the first element of the tuple.
       */
      typedef T1 Type;
    };
    
    
    /**
     * @brief Get the N-th element of a tuple.
     */
--- 380,478 ----
      {}
  
      template<class U1, class U2>
!     tuple& operator=(const Pair<U1,U2>& other)
      {
        FirstPair::operator=(other);
        return *this;
      }
    };
  
+ #endif
+ 
+   // be backwards compatible
+ #define Tuple tuple
+ 
+ #ifdef HAVE_TUPLE
+   using std::tuple_element;
+ #elif defined HAVE_TR1_TUPLE
+   using std::tr1::tuple_element;
+ #else
    /**
     * @brief Get the type of the N-th element of the tuple.
     */
    template<int N, class Tuple>
!   struct tuple_element
!   {
!     /**
!      * @brief The type of the N-th element of the tuple.
!      */
!     typedef typename tuple_element<N,typename Tuple::FirstPair>::type type;
!     typedef typename tuple_element<N,typename Tuple::FirstPair>::type Type;
!   };
    
    template<int N, typename T1, typename T2>
!   struct tuple_element<N,Pair<T1,T2> >
    {
      /**
       * @brief The type of the N-th element of the tuple.
       */
!     typedef typename tuple_element<N-1,T2>::Type type;
!     typedef typename tuple_element<N-1,T2>::Type Type;
    };
    
    /**
     * @brief Get the type of the first element of the tuple.
     */
    template<typename T1, typename T2>
!   struct tuple_element<0, Pair<T1,T2> >
    {
      /**
       * @brief The type of the first element of the tuple.
       */
+     typedef T1 type;
      typedef T1 Type;
    };
    
+ #endif
+ #define ElementType tuple_element
    
+ #ifdef HAVE_TR1_TUPLE
+   using std::tr1::get;
+ 
+   // for backwards compatibility
+     template<int i>
+   struct Element{
+     template<typename T1>
+     static typename TupleAccessTraits<typename tuple_element<i,T1>::type>::NonConstType get(T1& t)
+     {
+       return std::tr1::get<i>(t);
+     }
+ 
+     template<typename T1>
+     static typename TupleAccessTraits<typename tuple_element<i,T1>::type>::ConstType get(const T1& t)
+     {
+       return std::tr1::get<i>(t);
+     }
+   };
+ #elif defined HAVE_TUPLE
+   using std::get;
+ 
+   // for backwards compatibility
+     template<int i>
+   struct Element{
+     template<typename T1>
+     static typename TupleAccessTraits<typename tuple_element<i,T1>::type>::NonConstType get(T1& t)
+     {
+       return std::get<i>(t);
+     }
+ 
+     template<typename T1>
+     static typename TupleAccessTraits<typename tuple_element<i,T1>::type>::ConstType get(const T1& t)
+     {
+       return std::get<i>(t);
+     }
+   };
+ #else
    /**
     * @brief Get the N-th element of a tuple.
     */
*************** namespace Dune 
*** 416,422 ****
       */
      template<typename T1, typename T2>
      static typename TupleAccessTraits<
!       typename ElementType<N,Pair<T1,T2> >::Type
      >::NonConstType
      get(Pair<T1,T2>& tuple)
      {
--- 486,492 ----
       */
      template<typename T1, typename T2>
      static typename TupleAccessTraits<
!       typename tuple_element<N,Pair<T1,T2> >::type
      >::NonConstType
      get(Pair<T1,T2>& tuple)
      {
*************** namespace Dune 
*** 430,436 ****
       */
      template<typename T1, typename T2>
      static typename TupleAccessTraits<
!       typename ElementType<N,Pair<T1,T2> >::Type
      >::ConstType
      get(const Pair<T1,T2>& tuple)
      {
--- 500,506 ----
       */
      template<typename T1, typename T2>
      static typename TupleAccessTraits<
!       typename tuple_element<N,Pair<T1,T2> >::type
      >::ConstType
      get(const Pair<T1,T2>& tuple)
      {
*************** namespace Dune 
*** 467,472 ****
--- 537,638 ----
      }
    };
  
+   template<int i, typename T1, typename T2, typename T3, typename T4,
+ 	   typename T5, typename T6, typename T7, typename T8, typename T9>
+   typename TupleAccessTraits<typename tuple_element<i, tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::type>
+   ::NonConstType 
+   get(tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
+   {
+     return Element<i>::get(t);
+   }
+ 
+ #endif  
+ 
+ #ifdef HAVE_TR1_TUPLE
+   using std::tr1::tuple_size;
+ #elif defined HAVE_TUPLE
+   using std::tuple_size;
+ #else
+   /**
+    * @brief Template meta_programm to query the size of a tuple
+    *
+    */
+   template<class T>
+   struct tuple_size
+   {
+     enum{ 
+       // @brief The number of Elements in the tuple.
+       value=tuple_size<typename T::FirstPair>::value
+ 	};
+     
+     
+   };
+   
+   template<typename T1, typename T2>
+   struct tuple_size<Pair<T1,T2> >
+   {
+     enum{ value=1+tuple_size<T2>::value};
+   };
+   
+   
+   template<typename T1>
+   struct tuple_size<Pair<T1,Nil> >
+   {
+     enum{ value=1};
+   };
+ 
+   template<>
+   struct tuple_size<Pair<Nil,Nil> >
+   {
+     enum{ value=0};
+   };
+ #endif
+ 
+ #define Size  tuple_size
+ 
+ #ifdef HAVE_TR1_TUPLE    
+   using std::tr1::tie;
+   using std::tr1::make_tuple;
+ #endif
+ #ifdef HAVE_TUPLE    
+   using std::tie;
+   using std::make_tuple;
+ #endif
+ 
+ #if defined HAVE_TUPLE || defined HAVE_TR1_TUPLE
+   template<int i>
+   struct tuple_writer
+   {
+     template<class Tuple>
+     static std::ostream& put(std::ostream& os, const Tuple& t)
+     {
+       return tuple_writer<i-1>::put(os,t)<<", "<<get<i-1>(t);
+     }
+   };
+   
+   template<>
+   struct tuple_writer<0>
+   {
+     template<class Tuple>
+     static std::ostream& put(std::ostream& os, const Tuple& t)
+     {
+       return os;
+     }
+   };
+ 
+   /** 
+    * \brief Print a tuple.
+    */
+   template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7,
+ 	   typename T8, typename T9>
+   inline std::ostream& operator<<( std::ostream& os, tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> t)
+   {
+     typedef tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> Tuple;
+     return tuple_writer<tuple_size<Tuple>::value>::put(os, t);
+   }
+ 
+   
+ #else
    /**
     * @brief Equality comparison operator for tuples.
     * @param tuple1 The first tuple.
*************** namespace Dune 
*** 597,603 ****
    }
  
    /**
!    * @brief Print a pair or tuple.
     */
    template<typename T1, typename T2>
    inline std::ostream& operator<<(std::ostream& os, const Pair<T1,T2>& pair)
--- 763,769 ----
    }
  
    /**
!    * @brief Print aa pair or  tuple.
     */
    template<typename T1, typename T2>
    inline std::ostream& operator<<(std::ostream& os, const Pair<T1,T2>& pair)
*************** namespace Dune 
*** 614,672 ****
    }
  
    template<class T1>
!   inline Tuple<T1&> tie(T1& t1) {
!     return Tuple<T1&> (t1);
    }
  
    template<class T1, class T2>
!   inline Tuple<T1&, T2&> tie(T1& t1, T2& t2) {
!     return Tuple<T1&, T2&> (t1, t2);
    }
  
    template<class T1, class T2, class T3>
!   inline Tuple<T1&, T2&, T3&> tie(T1& t1, T2& t2, T3& t3) {
!     return Tuple<T1&, T2&, T3&> (t1, t2, t3);
    }
  
    template<class T1, class T2, class T3, class T4>
!   inline Tuple<T1&, T2&, T3&, T4&> tie(T1& t1, T2& t2, T3& t3, T4& t4) {
!     return Tuple<T1&, T2&, T3&, T4&> (t1, t2, t3, t4);
    }
  
    template<class T1, class T2, class T3, class T4, class T5>
!   inline Tuple<T1&, T2&, T3&, T4&, T5&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) {
!     return Tuple<T1&, T2&, T3&, T4&, T5&> (t1, t2, t3, t4, t5);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6>
!   inline Tuple<T1&, T2&, T3&, T4&, T5&, T6&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6) {
!     return Tuple<T1&, T2&, T3&, T4&, T5&, T6&> (t1, t2, t3, t4, t5, t6);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
!   inline Tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7) {
!     return Tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&> (t1, t2, t3, t4, t5, t6, t7);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
  	   class T8>
!   inline Tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8) {
!     return Tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
        (t1, t2, t3, t4, t5, t6, t7, t8);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
  	   class T8, class T9>
!   inline Tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, T9& t9) {
!     return Tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
        (t1, t2, t3, t4, t5, t6, t7, t8, t9);
    }
  
  
    template<typename T1, typename TT>
    template<typename T2, typename T3, typename T4, typename T5,
--- 780,894 ----
    }
  
    template<class T1>
!   inline tuple<T1&> tie(T1& t1) {
!     return tuple<T1&> (t1);
    }
  
    template<class T1, class T2>
!   inline tuple<T1&, T2&> tie(T1& t1, T2& t2) {
!     return tuple<T1&, T2&> (t1, t2);
    }
  
    template<class T1, class T2, class T3>
!   inline tuple<T1&, T2&, T3&> tie(T1& t1, T2& t2, T3& t3) {
!     return tuple<T1&, T2&, T3&> (t1, t2, t3);
    }
  
    template<class T1, class T2, class T3, class T4>
!   inline tuple<T1&, T2&, T3&, T4&> tie(T1& t1, T2& t2, T3& t3, T4& t4) {
!     return tuple<T1&, T2&, T3&, T4&> (t1, t2, t3, t4);
    }
  
    template<class T1, class T2, class T3, class T4, class T5>
!   inline tuple<T1&, T2&, T3&, T4&, T5&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) {
!     return tuple<T1&, T2&, T3&, T4&, T5&> (t1, t2, t3, t4, t5);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6>
!   inline tuple<T1&, T2&, T3&, T4&, T5&, T6&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6) {
!     return tuple<T1&, T2&, T3&, T4&, T5&, T6&> (t1, t2, t3, t4, t5, t6);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
!   inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7) {
!     return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&> (t1, t2, t3, t4, t5, t6, t7);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
  	   class T8>
!   inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8) {
!     return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
        (t1, t2, t3, t4, t5, t6, t7, t8);
    }
  
    template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
  	   class T8, class T9>
!   inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
    tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, T9& t9) {
!     return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
        (t1, t2, t3, t4, t5, t6, t7, t8, t9);
    }
  
+   template<class T1>
+   inline tuple<T1> make_tuple(const T1& t1) {
+     return tuple<T1> (t1);
+   }
+ 
+   template<class T1, class T2>
+   inline tuple<T1, T2> make_tuple(const T1& t1, const T2& t2) {
+     return tuple<T1, T2> (t1, t2);
+   }
+ 
+   template<class T1, class T2, class T3>
+   inline tuple<T1, T2, T3> make_tuple(const T1& t1, const T2& t2, const T3& t3) {
+     return tuple<T1, T2, T3> (t1, t2, t3);
+   }
+ 
+   template<class T1, class T2, class T3, class T4>
+   inline tuple<T1, T2, T3, T4> make_tuple(const T1& t1, const T2& t2, const T3& t3, const T4& t4) {
+     return tuple<T1, T2, T3, T4> (t1, t2, t3, t4);
+   }
+ 
+   template<class T1, class T2, class T3, class T4, class T5>
+   inline tuple<T1, T2, T3, T4, T5>
+   make_tuple(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5) {
+     return tuple<T1, T2, T3, T4, T5> (t1, t2, t3, t4, t5);
+   }
+ 
+   template<class T1, class T2, class T3, class T4, class T5, class T6>
+   inline tuple<T1, T2, T3, T4, T5, T6>
+   make_tuple(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6) {
+     return tuple<T1, T2, T3, T4, T5, T6> (t1, t2, t3, t4, t5, t6);
+   }
+ 
+   template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
+   inline tuple<T1, T2, T3, T4, T5, T6, T7>
+   make_tuple(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6,
+ 	     const T7& t7) {
+     return tuple<T1, T2, T3, T4, T5, T6, T7> (t1, t2, t3, t4, t5, t6, t7);
+   }
+ 
+   template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
+ 	   class T8>
+   inline tuple<T1, T2, T3, T4, T5, T6, T7, T8>
+   make_tuple(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6,
+ 	     const T7& t7, const T8& t8) {
+     return tuple<T1, T2, T3, T4, T5, T6, T7, T8>
+       (t1, t2, t3, t4, t5, t6, t7, t8);
+   }
+ 
+   template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
+ 	   class T8, class T9>
+   inline tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>
+   make_tuple(const T1& t1, const T2& t2, const T3& t3, const T4& t4, const T5& t5, const T6& t6,
+ 	     const  T7& t7, const T8& t8, const T9& t9) {
+     return tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>
+       (t1, t2, t3, t4, t5, t6, t7, t8, t9);
+   }
  
    template<typename T1, typename TT>
    template<typename T2, typename T3, typename T4, typename T5,
*************** namespace Dune 
*** 793,798 ****
      return first_;
    }
   
  }
- 
  #endif
--- 1015,1020 ----
      return first_;
    }
   
+ #endif
  }
  #endif
diff -p --exclude=Makefile.am --exclude=Makefile.in common/typetraits.hh ../dune-common-1.1/common/typetraits.hh
*** common/typetraits.hh	Mon Apr 16 13:39:15 2007
--- ../dune-common-1.1/common/typetraits.hh	Thu Apr  3 03:59:02 2008
***************
*** 1,6 ****
--- 1,14 ----
  #ifndef DUNE_TYPETRAITS_HH
  #define DUNE_TYPETRAITS_HH
  
+ #include <dune/common/deprecated.hh>
+ 
+ #ifdef HAVE_TR1_TYPE_TRAITS
+ #include <tr1/type_traits>
+ #elif defined HAVE_TYPE_TRAITS
+ #include <type_traits>
+ #endif
+ 
  namespace Dune
  {
    
*************** namespace Dune
*** 147,161 ****
      typedef volatile typename ConstantVolatileTraits<T>::UnqualifiedType Type;
    };
  
  
    /**
     * @brief Removes a const qualifier while preserving others.
     */
    template<typename T>
!   struct RemoveConst
    {
!     typedef typename RemoveConstHelper<T, IsVolatile<T>::value>::Type Type;
    };
  
    /**
     * @brief Checks wether a type is derived from another.
--- 155,185 ----
      typedef volatile typename ConstantVolatileTraits<T>::UnqualifiedType Type;
    };
  
+ #ifdef HAVE_TR1_TYPE_TRAITS
+     using std::tr1::remove_const;
+ #elif defined HAVE_TYPE_TRAITS
+   using std::remove_const;
+ #else
  
    /**
     * @brief Removes a const qualifier while preserving others.
     */
    template<typename T>
!   struct remove_const
    {
!       typedef typename RemoveConstHelper<T, IsVolatile<T>::value>::Type type;
    };
+ #endif
+ 
+   /**
+    * @brief Removes a const qualifier while preserving others.
+    * \deprecated Use remove_const instead!
+    */
+   template<typename T>
+   struct RemoveConst
+   {
+       typedef typename RemoveConstHelper<T, IsVolatile<T>::value>::Type Type;
+   } DUNE_DEPRECATED;
  
    /**
     * @brief Checks wether a type is derived from another.
*************** namespace Dune
*** 175,181 ****
      enum {
        /** @brief True if the conversion exists. */
        exists =  sizeof(test(makeFrom())) == sizeof(Small),
!       /** @brief Wether the conversion exists in both ways. */
        isTwoWay = exists && Conversion<To,From>::exists,
        /** @brief True if To and From are the same type. */
        sameType = false
--- 199,205 ----
      enum {
        /** @brief True if the conversion exists. */
        exists =  sizeof(test(makeFrom())) == sizeof(Small),
!       /** @brief Whether the conversion exists in both ways. */
        isTwoWay = exists && Conversion<To,From>::exists,
        /** @brief True if To and From are the same type. */
        sameType = false
*************** namespace Dune
*** 254,266 ****
      : public EnableIf<IsInteroperable<T1,T2>::value, Type>
    {};
    
! 
    /**
     * @brief Compile time test for testing whether 
     * two types are the same.
     */
    template<typename T1, typename T2>
!   struct SameType
    {
      enum{ 
        /* @brief Whether T1 is the same type as T2. */
--- 278,294 ----
      : public EnableIf<IsInteroperable<T1,T2>::value, Type>
    {};
    
! #ifdef HAVE_TR1_TYPE_TRAITS
!     using std::tr1::is_same;
! #elif defined HAVE_TYPE_TRAITS
!   using std::is_same;
! #else
    /**
     * @brief Compile time test for testing whether 
     * two types are the same.
     */
    template<typename T1, typename T2>
!   struct is_same
    {
      enum{ 
        /* @brief Whether T1 is the same type as T2. */
*************** namespace Dune
*** 270,279 ****
    
    
    template<typename T>
!   struct SameType<T,T>
    {
      enum{ value=true};
    };
  
    /**
     * @brief Select a type based on a condition.
--- 298,332 ----
    
    
    template<typename T>
!   struct is_same<T,T>
    {
      enum{ value=true};
    };
+ #endif
+ 
+   /**
+    * @brief Compile time test for testing whether two types are the same.
+    * \deprecated Use is_same instead!
+    */
+   template<typename T1, typename T2>
+   struct SameType
+   {
+     enum{ 
+       /* @brief Whether T1 is the same type as T2. */
+       value=false
+ 	};
+   } DUNE_DEPRECATED;
+   
+   
+   /**
+    * @brief Compile time test for testing whether two types are the same.
+    * \deprecated Use is_same instead!
+    */
+   template<typename T>
+   struct SameType<T,T>
+   {
+     enum{ value=true};
+   } DUNE_DEPRECATED;
  
    /**
     * @brief Select a type based on a condition.
diff -p --exclude=Makefile.am --exclude=Makefile.in common/utility.hh ../dune-common-1.1/common/utility.hh
*** common/utility.hh	Thu Jan 18 13:00:15 2007
--- ../dune-common-1.1/common/utility.hh	Thu Apr  3 03:59:02 2008
*************** namespace Dune {
*** 22,58 ****
     * A tuple of NULL pointers may be useful when you use a tuple of pointers
     * in a class which you can only initialise in a later stage.
     */
!   template <class PairT>
    class NullPointerInitialiser {};
    
!   /**
!    * @brief Specialisation for standard tuple element.
!    */
!   template <class Head, class Tail>
!   class NullPointerInitialiser<Pair<Head*, Tail> > {
!   public:
!     //! The subpart of the tuple which is handed back to the next instance
!     //! of the NullPointerInitialiser.
!     typedef Pair<Head*, Tail> ResultType;
!   public:
!     //! Static method to build up tuple.
!     static inline ResultType apply() {
!       return ResultType(0, NullPointerInitialiser<Tail>::apply());
!     }
!   };
    
!   /**
!    * @brief Specialisation for last (Nil) element.
!    */
!   template <>
!   class NullPointerInitialiser<Nil> {
!   public:
!     //! The return type of the close is Nil.
!     typedef Nil ResultType;
    public:
!     //! Provide closure of tuple
!     static inline ResultType apply() {
!       return Nil();
      }
    };
    
--- 22,142 ----
     * A tuple of NULL pointers may be useful when you use a tuple of pointers
     * in a class which you can only initialise in a later stage.
     */
!   template <class Tuple>
    class NullPointerInitialiser {};
    
!   namespace
!   {
!     /**
!      * @brief Helper class for initialising null pointers.
!      *
!      * First template parameter is the tuple.
!      * Second templates parameter is the size of the tuple.
!      */
!     template<class T, int size>
!     struct InitialiserHelper
!     {};
!     
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2,T3,T4,T5,T6,T7,T8,T9>,1>
!     {
!       static inline tuple<T1*,T2,T3,T4,T5,T6,T7,T8,T9> apply()
!       {
! 	return tuple<T1*,T2,T3,T4,T5,T6,T7,T8,T9>(0);
!       }
!     };
! 
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3,T4,T5,T6,T7,T8,T9>,2>
!     {
!       static inline tuple<T1*,T2*,T3,T4,T5,T6,T7,T8,T9> apply()
!       {
! 	return tuple<T1*,T2*,T3,T4,T5,T6,T7,T8,T9>(0,0);
!       }
!     };
!     
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3*,T4,T5,T6,T7,T8,T9>,3>
!     {
!       static inline tuple<T1*,T2*,T3*,T4,T5,T6,T7,T8,T9> apply()
!       {
! 	return tuple<T1*,T2*,T3*,T4,T5,T6,T7,T8,T9>(0,0,0);
!       }
!     };
    
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3*,T4*,T5,T6,T7,T8,T9>,4>
!     {
!       static inline tuple<T1*,T2*,T3*,T4*,T5,T6,T7,T8,T9> apply()
!       {
! 	return tuple<T1*,T2*,T3*,T4*,T5,T6,T7,T8,T9>(0,0,0,0);
!       }
!     };
! 
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3*,T4*,T5*,T6,T7,T8,T9>,5>
!     {
!       static inline tuple<T1*,T2*,T3*,T4*,T5*,T6,T7,T8,T9> apply()
!       {
! 	return tuple<T1*,T2*,T3*,T4*,T5*,T6,T7,T8,T9>(0,0,0,0,0);
!       }
!     };
! 
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7,T8,T9>,6>
!     {
!       static inline tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7,T8,T9> apply()
!       {
! 	return tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7,T8,T9>(0,0,0,0,0,0);
!       }
!     };
! 
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8,T9>,7>
!     {
!       static inline tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8,T9> apply()
!       {
! 	return tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8,T9>(0,0,0,0,0,0,0);
!       }
!     };
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8*,T9>,8>
!     {
!       static inline tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8*,T9> apply()
!       {
! 	return tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8*,T9>(0,0,0,0,0,0,0,0);
!       }
!     };
! 
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct InitialiserHelper<tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8*,T9*>,9>
!     {
!       static inline tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8*,T9*> apply()
!       {
! 	return tuple<T1*,T2*,T3*,T4*,T5*,T6*,T7*,T8*,T9*>(0,0,0,0,0,0,0,0,0);
!       }
!     };
!   }
!   
!   template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!   class NullPointerInitialiser<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >
!   {
    public:
!     typedef tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> ResultType;
!     
!     static inline ResultType apply()
!     {
!       return InitialiserHelper<ResultType, tuple_size<ResultType>::value>::apply();
      }
    };
    
*************** namespace Dune {
*** 62,119 ****
     * \warning Pointers cannot be set to NULL, so calling the Deletor twice
     * or accessing elements of a deleted tuple leads to unforeseeable results!
     */
!   template <class PairT>
    struct PointerPairDeletor {};
-   
-   /**
-    * @brief Specialisation for a standard tuple element.
-    */
-   template <class Head, class Tail>
-   struct PointerPairDeletor<Pair<Head*, Tail> > {
-     //! Deletes object pointed to by first element and triggers deletion on 
-     //! subsequent pairs.
-     static void apply(Pair<Head*, Tail>& p) {
-       delete p.first();
-       PointerPairDeletor<Tail>::apply(p.second());
-     }
-   };
  
!   /**
!    * @brief Specialisation for last (non-Nil) tuple element.
!    */
!   template <class Head>
!   struct PointerPairDeletor<Pair<Head*, Nil> > {
!     //! Deletes object pointed to by first element.
!     static void apply(Pair<Head*, Nil>& p) {
!       delete p.first();
      }
    };
    
    /**
     * @brief Helper template to calculate length of a tuple.
     */
!   template <class PairT>
    struct Length {};
  
!   /**
!    * @brief Specialisation for a standard tuple element.
!    *
!    * The length of the tuple is stored by the enumeration value.
!    */
!   template <class Head, class Tail>
!   struct Length<Pair<Head, Tail> > {
!     //! The length of the (sub)tuple.
!     enum { value = 1 + Length<Tail>::value };
    };
  
!   /**
!    * @brief Specialisation for the closure.
!    */
!   template <>
!   struct Length<Nil> {
!     //! The length of an empty tuple is zero by definition.
!     enum { value = 0 };
!   };
  
    /**
     * @brief Helper template to clone the type definition of a tuple with the
--- 146,307 ----
     * \warning Pointers cannot be set to NULL, so calling the Deletor twice
     * or accessing elements of a deleted tuple leads to unforeseeable results!
     */
!   template <class Tuple>
    struct PointerPairDeletor {};
  
!   namespace
!   {
!     
!     template<class T, int s>
!     struct PointerDeletor
!     {};
!     
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9, int s>
!     struct PointerDeletor<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,s>
!     {
!       static void apply(tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
!       {
! 	
! 	PointerDeletor<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,s-1>::apply(t);
! 	delete get<s-1>(t);
!       }
!     };
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct PointerDeletor<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,0>
!     {
!       static void apply(tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
!       {}
!     };  
!   }
!   
!   template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!   struct PointerPairDeletor<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >
!   {
!     static void apply(tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
!     {
!       PointerDeletor<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>, 
! 	tuple_size<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::value>
! 	::apply(t);
      }
+     
    };
    
    /**
     * @brief Helper template to calculate length of a tuple.
     */
!   template <class Tuple>
    struct Length {};
  
!   template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!   struct Length<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >
!   {
!     enum{ 
!       value=tuple_size<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::value
! 	};
    };
+   
+   namespace
+   {
+     /**
+      * @brief Helper class for getting a converted tuple.
+      *
+      * Eval describes the conversion policy, T is the tuple type
+      * and s is the size of the (sub) tuple, to process.
+      */
+     template<template <class> class Eval, typename T, int s>
+     struct ForEachTypeHelper
+     {};
+     
+     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
+ 	     typename T6, typename T7, typename T8, typename T9>
+     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,0>
+     {
+       typedef tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> Type;
+     };
+     
+     
+     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
+ 	     typename T6, typename T7, typename T8, typename T9>
+     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,1>
+     {
+       typedef tuple<typename Eval<T1>::Type,T2,T3,T4,T5,T6,T7,T8,T9> Type;
+     };
+     
+     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
+ 	     typename T6, typename T7, typename T8, typename T9>
+     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,2>
+     {
+       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,T3,T4,T5,T6,T7,T8,T9> Type;
+     };
+ 
+     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
+ 	     typename T6, typename T7, typename T8, typename T9>
+     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,3>
+     {
+       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,typename Eval<T3>::Type,
+ 		    T4,T5,T6,T7,T8,T9> Type;
+     };
+ 
+     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
+ 	     typename T6, typename T7, typename T8, typename T9>
+     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,4>
+     {
+       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,typename Eval<T3>::Type,
+ 		    typename Eval<T4>::Type,T5,T6,T7,T8,T9> Type;
+     };
+     
+     
+     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
+ 	     typename T6, typename T7, typename T8, typename T9>
+     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,5>
+     {
+       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,typename Eval<T3>::Type,
+ 		    typename Eval<T4>::Type,typename Eval<T5>::Type,T6,T7,T8,T9> Type;
+     };
  
!     
!     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,6>
!     {
!       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,typename Eval<T3>::Type,
! 		    typename Eval<T4>::Type,typename Eval<T5>::Type,typename Eval<T6>::Type,
! 		    T7,T8,T9> Type;
!     };
! 
!     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,7>
!     {
!       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,typename Eval<T3>::Type,
! 		    typename Eval<T4>::Type,typename Eval<T5>::Type,typename Eval<T6>::Type,
! 		    typename Eval<T7>::Type,T8,T9> Type;
!     };
! 
!     
!     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,8>
!     {
!       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,typename Eval<T3>::Type,
! 		    typename Eval<T4>::Type,typename Eval<T5>::Type,typename Eval<T6>::Type,
! 		    typename Eval<T7>::Type,typename Eval<T8>::Type,T9> Type;
!     };
!     
!     template<template <class> class Eval, typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     struct ForEachTypeHelper<Eval,tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>,9>
!     {
!       typedef tuple<typename Eval<T1>::Type,typename Eval<T2>::Type,typename Eval<T3>::Type,
! 		    typename Eval<T4>::Type,typename Eval<T5>::Type,typename Eval<T6>::Type,
! 		    typename Eval<T7>::Type,typename Eval<T8>::Type,typename Eval<T9>::Type> Type;
!     };
!   }
!   
  
    /**
     * @brief Helper template to clone the type definition of a tuple with the
*************** namespace Dune {
*** 134,166 ****
     * the storage types of the tuple defined by the tuple ATuple.
     */
    template <template <class> class TypeEvaluator, class TupleType>
!   struct ForEachType {};
! 
!   /**
!    * @brief Specialisation for standard tuple element
!    */  
!   template <template <class> class TypeEvaluator, class Head, class Tail>
!   struct ForEachType<TypeEvaluator, Pair<Head, Tail> > {
!     //! Defines type corresponding to the subtuple defined by Pair<Head, Tail>
!     typedef Pair<typename TypeEvaluator<Head>::Type, 
!                  typename ForEachType<TypeEvaluator, Tail>::Type> Type;
!   };
!   
!   /**
!    * @brief Specialisation for last element
!    */
!   template <template <class> class TypeEvaluator>
!   struct ForEachType<TypeEvaluator, Nil> {
!     typedef Nil Type;
    };
  
! //   template <template <class> class TypeEvaluator, class Head>
! //   struct ForEachType<TypeEvaluator, Pair<Head, Nil> > {
! //     //! For the storage element, Head is replaced by the expression provided
! //     //! by the TypeEvaluator helper template.
! //     typedef Pair<typename TypeEvaluator<Head>::Type, Nil> Type;
! //   };
! 
    /**
     * @brief Helper template which implements iteration over all storage 
     * elements in a tuple.
--- 322,370 ----
     * the storage types of the tuple defined by the tuple ATuple.
     */
    template <template <class> class TypeEvaluator, class TupleType>
!   struct ForEachType {
!     typedef typename ForEachTypeHelper<TypeEvaluator,TupleType,
! 				       tuple_size<TupleType>::value>::Type Type;
!     
    };
  
!   namespace
!   {
!     template<int i, typename T1,typename F>
!     struct Visitor
!     {
!       static inline void visit(F& func, T1& t1)
!       {
! 	func.visit(get<tuple_size<T1>::value-i>(t1));
! 	Visitor<i-1,T1,F>::visit(func, t1);
!       }
!     };
! 	
!     template<typename T1,typename F>
!     struct Visitor<0,T1,F>
!     {
!       static inline void visit(F& func, T1& t1)
!       {}
!     };
! 
!     template<int i, typename T1, typename T2,typename F>
!     struct PairVisitor
!     {
!       static inline void visit(F& func, T1& t1, T2& t2)
!       {
! 	func.visit(get<tuple_size<T1>::value-i>(t1), get<tuple_size<T2>::value-i>(t2));
! 	PairVisitor<i-1,T1,T2,F>::visit(func, t1, t2);
!       }
!     };
! 	
!     template<typename T1, typename T2, typename F>
!     struct PairVisitor<0,T1,T2,F>
!     {
!       static inline void visit(F& func, T1& t1, T2& t2)
!       {}
!     };
!   }
!   
    /**
     * @brief Helper template which implements iteration over all storage 
     * elements in a tuple.
*************** namespace Dune {
*** 205,225 ****
      //! \param f Function object.
      template <class Functor>
      void apply(Functor& f) {
!       apply(f, tuple_);
!     }
!     
!   private:
!     //! Specialisation for the last element
!     template <class Functor, class Head>
!     void apply(Functor& f, Pair<Head, Nil>& last) {
!       f.visit(last.first());
!     }
!     
!     //! Specialisation for a standard tuple element
!     template <class Functor, class Head, class Tail>
!     void apply(Functor& f, Pair<Head, Tail>& pair) {
!       f.visit(pair.first());
!       apply(f, pair.second());
      }
    private:
      TupleType& tuple_;
--- 409,415 ----
      //! \param f Function object.
      template <class Functor>
      void apply(Functor& f) {
!       Visitor<tuple_size<TupleType>::value,TupleType,Functor>::visit(f, tuple_);
      }
    private:
      TupleType& tuple_;
*************** namespace Dune {
*** 256,278 ****
      //! \param f The function object to apply on the pair of tuples.
      template <class Functor>
      void apply(Functor& f) {
!       apply(f, tuple1_, tuple2_);
!     }
! 
!   private:
!     //! Specialisation for the last element.
!     template <class Functor, class Head1, class Head2>
!     void apply(Functor& f, Pair<Head1, Nil>& last1, Pair<Head2, Nil>& last2) {
!       f.visit(last1.first(), last2.first());
      }
- 
-     //! Specialisation for a standard element.
-     template <class Functor, class Head1, class Tail1, class Head2,class Tail2>
-     void apply(Functor& f, Pair<Head1, Tail1>& p1, Pair<Head2, Tail2>& p2) {
-       f.visit(p1.first(), p2.first());
-       apply(f, p1.second(), p2.second());
-     }
- 
    private:
      TupleType1& tuple1_;
      TupleType2& tuple2_;
--- 446,454 ----
      //! \param f The function object to apply on the pair of tuples.
      template <class Functor>
      void apply(Functor& f) {
!       PairVisitor<tuple_size<TupleType1>::value,TupleType1,TupleType2,Functor>
! 	::visit(f, tuple1_, tuple2_);
      }
    private:
      TupleType1& tuple1_;
      TupleType2& tuple2_;
*************** namespace Dune {
*** 300,319 ****
    template <int N>
    struct At 
    {
-     template <class T1, class T2>
-     static typename ElementType<Length<Pair<T1, T2> >::value - N - 1, 
-                                 Pair<T1, T2> >::Type& 
-     get(Pair<T1, T2>& tuple) {
-       return Element<Length<Pair<T1, T2> >::value - N - 1>::get(tuple);
-     }
  
!     template <class T1, class T2>
!     static const typename ElementType<Length<Pair<T1, T2> >::value - N - 1, 
!                                       Pair<T1, T2> >::Type& 
!     get(const Pair<T1, T2>& tuple) {
!       return Element<Length<Pair<T1, T2> >::value - N - 1>::get(tuple);
      }
- 
    };
  
  }
--- 476,501 ----
    template <int N>
    struct At 
    {
  
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     static typename TupleAccessTraits<
!       typename tuple_element<tuple_size<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::value - N - 1,
! 			     tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::type>::NonConstType
!     get(tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
!     {
!       return Dune::get<tuple_size<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::value - N - 1>(t);
!     }
!     
!     template<typename T1, typename T2, typename T3, typename T4, typename T5,
! 	     typename T6, typename T7, typename T8, typename T9>
!     static typename TupleAccessTraits<
!       typename tuple_element<tuple_size<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::value - N - 1,
! 			     tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::type>::ConstType
!     get(const tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9>& t)
!     {
!       return Dune::get<tuple_size<tuple<T1,T2,T3,T4,T5,T6,T7,T8,T9> >::value - N - 1>(t);
      }
    };
  
  }
