You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@mesos.apache.org by "Michael Park (JIRA)" <ji...@apache.org> on 2015/08/06 03:05:04 UTC

[jira] [Created] (MESOS-3214) Replace boost foreach with range-based for

Michael Park created MESOS-3214:
-----------------------------------

             Summary: Replace boost foreach with range-based for
                 Key: MESOS-3214
                 URL: https://issues.apache.org/jira/browse/MESOS-3214
             Project: Mesos
          Issue Type: Task
          Components: stout
            Reporter: Michael Park


Replace boost {{foreach}} macro with the C++11 range-based {{for}}. This will help avoid some of the pitfalls of boost {{foreach}} such as dealing with types with commas in them, as well as improving compiler diagnostics by avoiding the macro expansion.

The existing {{foreach (const Elem& elem, container)}} can be replaced with {{for (const Elem& elem : container)}}.

{{foreachpair}}, {{foreachkey}} and {{foreachvalue}} will still be supported for cases where the implicit unpacking is useful.

The implementation of {{foreachpair}} can be simplified with the use of range-based for within, {{foreachkey}} and {{foreachvalue}} will be exactly as is except it can use {{std::ignore}} instead of the hand-rolled version.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)