[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Use iterator for STL std::map element access.
From: |
Han-Wen Nienhuys |
Subject: |
Re: [PATCH] Use iterator for STL std::map element access. |
Date: |
Mon, 29 Mar 2010 00:10:52 -0300 |
On Sun, Mar 28, 2010 at 8:54 PM, Patrick McCarty <address@hidden> wrote:
> Hi,
>
> Please review this patch:
>
> http://codereview.appspot.com/819041/show
>
> I'm hoping this will fix Carl's compile failure:
> http://lists.gnu.org/archive/html/lilypond-devel/2010-03/msg00389.html
>
> Is this the correct way to return an element from a map?
It looks OK. Within google we have a function
template<class T>
bool FindCopy(T const& container, const T::key_type& key,
T::value_type * dest)
reduce the boilerplate involved with extracting values from STL maps.
You could introduce something like that, and rewrite other lookup code
like that.
--
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen