[v3 PATCH] Implement N4279, Improved insertion interface for unique-key maps.

Jonathan Wakely jwakely@redhat.com
Sat Aug 8 10:38:00 GMT 2015


On 07/08/15 09:36 +0100, Jonathan Wakely wrote:
>On 21/07/15 00:49 +0300, Ville Voutilainen wrote:
>+      template <typename... _Args>
>+      pair<iterator, bool>
>
>Indent everything after 'template<...>' please.
>
>+      try_emplace(const key_type& __k, _Args&&... __args)
>+      {
>+	iterator __i = lower_bound(__k);
>+	if (__i == end() || key_comp()(__k, (*__i).first))
>+          {
>+	    __i = emplace_hint(__i, std::piecewise_construct,
>+                    std::forward_as_tuple(__k),
>+                    std::forward_as_tuple(std::forward<_Args>(__args)...));
>+            return {__i, true};
>+          }
>+        return {__i, false};
>+      }
>
>Add a blank line between functions please.
>
>+      // move-capable overload
>+      template <typename... _Args>
>+      pair<iterator, bool>
>+      try_emplace(key_type&& __k, _Args&&... __args)
>
>
>
>+      template <typename _M>
>
>_M isn't documented as a BADNAME but single character names like that make me
>nervous, would _Obj or _Up be OK?
>
>+      pair<iterator, bool>
>+      insert_or_assign(const key_type& __k, _M&& __obj)
>+      {
>

P.S. I should have said it's OK for trunk with those changes.



More information about the Libstdc++ mailing list