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:06:05 UTC

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

     [ https://issues.apache.org/jira/browse/MESOS-3214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Park updated MESOS-3214:
--------------------------------
    Description: 
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)}} pattern 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.

  was:
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.


> 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
>              Labels: mesosphere
>
> 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)}} pattern 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)