• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1{
2    "key": "foreach",
3    "name": "Foreach",
4    "authors": [
5        "Eric Niebler"
6    ],
7    "description": "In C++, writing a loop that iterates over a sequence is tedious. We can either use iterators, which requires a considerable amount of boiler-plate, or we can use the std::for_each() algorithm and move our loop body into a predicate, which requires no less boiler-plate and forces us to move our logic far from where it will be used. In contrast, some other languages, like Perl, provide a dedicated \"foreach\" construct that automates this process. BOOST_FOREACH is just such a construct for C++. It iterates over sequences for us, freeing us from having to deal directly with iterators or write predicates.",
8    "category": [
9        "Algorithms",
10        "Emulation"
11    ],
12    "maintainers": [
13        "Eric Niebler <eric -at- boostpro.com>"
14    ]
15}
16