Re: [Boost-bugs] [Boost C++ Libraries] #5227: find_ptr wrapper for map::find

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #5227: find_ptr wrapper for map::find
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-03-15 18:30:10


#5227: find_ptr wrapper for map::find
-----------------------------------+----------------------------------------
  Reporter: olafvdspek@… | Owner: no-maintainer
      Type: Feature Requests | Status: new
 Milestone: Boost 1.47.0 | Component: utility
   Version: Boost 1.46.0 | Severity: Problem
Resolution: | Keywords:
-----------------------------------+----------------------------------------

Comment (by marshall):

 How about declaring the variable in the if statement?
 {{{
 if (auto i = very_long_name.find(1) != very_long_name.end())
      cout << i->second;
 }
 }}}

 That makes the code simpler.
 I'm not dismissing the suggestion for a wrapper; just looking at
 alternatives as well.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5227#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC