[Dune] [Dune-Commit] dune-common r4970 - trunk/common
Oliver Sander
sander at mi.fu-berlin.de
Wed Aug 15 13:51:51 CEST 2007
Hi Markus!
The default constructor of FixedArray is marked deprecated because
the whole class is deprecated. Unfortunately, deprecation of entire
classes is buggy in g++ (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16370).
Any use of FixedArray should be replaced by Dune::array, and FixedArray
should disappear completely after the next release.
--
Oliver
mblatt at dune-project.org wrote:
>Author: mblatt
>Date: 2007-08-15 11:35:41 +0200 (Wed, 15 Aug 2007)
>New Revision: 4970
>
>Modified:
> trunk/common/fixedarray.hh
>Log:
>Default constructor shouldn't be dreprecated as then there is no way
>of constructing it.
>Added assign methode as ther is no operator=(const T&) in std::tr1::array<T,int>.
>
>
>Modified: trunk/common/fixedarray.hh
>===================================================================
>--- trunk/common/fixedarray.hh 2007-08-08 10:01:51 UTC (rev 4969)
>+++ trunk/common/fixedarray.hh 2007-08-15 09:35:41 UTC (rev 4970)
>@@ -133,7 +133,7 @@
> enum { dimension = N };
>
> //! Create uninitialized array
>- FixedArray () DUNE_DEPRECATED {}
>+ FixedArray () {}
>
> //! Initialize all components with same size
> FixedArray (T t) DUNE_DEPRECATED
>@@ -144,13 +144,21 @@
> /** \brief Return array size */
> int size() const {return N;}
>
>- //! Assign value to all entries
>- FixedArray<T,N>& operator= (const T& t)
>+ /** \brief Assign value to all entries
>+ * @deprecated Use assign instead.
>+ */
>+ FixedArray<T,N>& operator= (const T& t) DUNE_DEPRECATED
> {
>- for (int i=0; i<N; i++) a[i]=t;
>+ 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)
> {
>
>
>_______________________________________________
>Dune-Commit mailing list
>Dune-Commit at dune-project.org
>http://lists.dune-project.org/mailman/listinfo/dune-commit
>
>
--
************************************************************************
* Oliver Sander ** email: sander at mi.fu-berlin.de *
* Freie Universität Berlin ** phone: + 49 (30) 838 75217 *
* Institut für Mathematik II ** URL : page.mi.fu-berlin.de/~sander *
* Arnimallee 6 ** -------------------------------------*
* 14195 Berlin, Germany ** Member of MATHEON (www.matheon.de) *
************************************************************************
More information about the Dune
mailing list