[PATCH] Return references in LayoutBase

Jeffrey D. Oldham oldham at codesourcery.com
Thu Jan 15 21:16:11 UTC 2004


Richard Guenther wrote:
> Hi!
> 
> This patch makes internalGuards(), externalGuards() and blocks() methods
> of LayoutBase return const references rather than copies.
> 
> Tested with no regressions on MPI intel linux.
> 
> Ok?
> 

Yes.

> Richard.
> 
> 
> 2004Jan14  Richard Guenther <richard.guenther at uni-tuebingen.de>
> 
> 	* src/Layout/LayoutBase.h: return const references in
> 	guard and block accessors.
> 
> ===== LayoutBase.h 1.10 vs edited =====
> --- 1.10/r2/src/Layout/LayoutBase.h	Wed Jan  7 12:17:55 2004
> +++ edited/LayoutBase.h	Tue Jan 13 23:37:13 2004
> @@ -204,12 +204,12 @@
>      return all_m[i]->allocated();
>    }
> 
> -  inline GuardLayers_t internalGuards() const
> +  inline const GuardLayers_t& internalGuards() const
>    {
>      return internalGuards_m;
>    }
> 
> -  inline GuardLayers_t externalGuards() const
> +  inline const GuardLayers_t& externalGuards() const
>    {
>      return externalGuards_m;
>    }
> @@ -243,7 +243,7 @@
> 
>    /// number of blocks along each axis.
> 
> -  inline Loc<Dim> blocks() const  { return blocks_m; }
> +  inline const Loc<Dim>& blocks() const  { return blocks_m; }
> 
>    ///@name Guard-cell related functions.
>    /// Iterators into the fill list. These are MultiPatch's interface to


-- 
Jeffrey D. Oldham
oldham at codesourcery.com




More information about the pooma-dev mailing list