1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>History and Acknowledgements</title> 6<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../foreach.html" title="Chapter 15. Boost.Foreach"> 10<link rel="prev" href="pitfalls.html" title="Pitfalls"> 11<link rel="next" href="../function.html" title="Chapter 16. Boost.Function"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td> 16<td align="center"><a href="../../../index.html">Home</a></td> 17<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="pitfalls.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../foreach.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../function.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="section"> 27<div class="titlepage"><div><div><h2 class="title" style="clear: both"> 28<a name="foreach.history_and_acknowledgements"></a><a class="link" href="history_and_acknowledgements.html" title="History and Acknowledgements">History and Acknowledgements</a> 29</h2></div></div></div> 30<h3> 31<a name="foreach.history_and_acknowledgements.h0"></a> 32 <span class="phrase"><a name="foreach.history_and_acknowledgements.history"></a></span><a class="link" href="history_and_acknowledgements.html#foreach.history_and_acknowledgements.history">History</a> 33 </h3> 34<p> 35 The ideas for <code class="literal">BOOST_FOREACH</code> began life in the Visual C++ 36 group at Microsoft during the early phases of the design for C++/CLI. Whether 37 to add a dedicated "foreach" looping construct to the language was 38 an open question at the time. As a mental exercise, Anson Tsao sent around 39 some proof-of-concept code which demonstrated that a pure library solution 40 might be possible. The code was written in the proposed C++/CLI dialect of 41 the time, for which there was no compiler as of yet. I was intrigued by the 42 possibility, and I ported his code to Managed C++ and got it working. We worked 43 together to refine the idea and eventually published an article about it in 44 the November 2003 issue of the CUJ. 45 </p> 46<p> 47 After leaving Microsoft, I revisited the idea of a looping construct. I reimplemented 48 the macro from scratch in standard C++, corrected some shortcomings of the 49 CUJ version and rechristened it <code class="literal">BOOST_FOREACH</code>. In October 50 of 2003 I began a discussion about it on the Boost developers list, where it 51 met with a luke-warm reception. I dropped the issue until December 2004, when 52 I reimplemented <code class="literal">BOOST_FOREACH</code> yet again. The new version 53 only evaluated its sequence expression once and correctly handled both lvalue 54 and rvalue sequence expressions. It was built on top of the recently accepted 55 <a href="../../../libs/range/index.html" target="_top">Boost.Range</a> library, which 56 increased its portability. This was the version that, on Dec. 12 2004, I finally 57 submitted to Boost for review. It was accepted into Boost on May 5, 2005. 58 </p> 59<h3> 60<a name="foreach.history_and_acknowledgements.h1"></a> 61 <span class="phrase"><a name="foreach.history_and_acknowledgements.acknowledgements"></a></span><a class="link" href="history_and_acknowledgements.html#foreach.history_and_acknowledgements.acknowledgements">Acknowledgements</a> 62 </h3> 63<p> 64 Thanks go out to Anson Tsao of Microsoft for coming up with the idea and demonstrating 65 its feasibility. I would also like to thank <a href="http://boost.org/people/thorsten_ottosen.html" target="_top">Thorsten 66 Ottosen</a> for the <a href="../../../libs/range/index.html" target="_top">Boost.Range</a> 67 library, on which the current version of <code class="literal">BOOST_FOREACH</code> is 68 built. Finally, I'd like to thank Russell Hind, Alisdair Meredith and Stefan 69 Slapeta for their help porting to various compilers. 70 </p> 71<h3> 72<a name="foreach.history_and_acknowledgements.h2"></a> 73 <span class="phrase"><a name="foreach.history_and_acknowledgements.further_reading"></a></span><a class="link" href="history_and_acknowledgements.html#foreach.history_and_acknowledgements.further_reading">Further 74 Reading</a> 75 </h3> 76<p> 77 For more information about how <code class="literal">BOOST_FOREACH</code> works, you 78 may refer to the article <a href="http://www.artima.com/cppsource/foreach.html" target="_top"><span class="quote">“<span class="quote">Conditional 79 Love</span>”</span></a> at <a href="http://www.artima.com/cppsource/" target="_top">The C++ 80 Source</a>. 81 </p> 82</div> 83<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 84<td align="left"></td> 85<td align="right"><div class="copyright-footer">Copyright © 2004 Eric Niebler<p> 86 Distributed under the Boost Software License, Version 1.0. (See accompanying 87 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 88 </p> 89</div></td> 90</tr></table> 91<hr> 92<div class="spirit-nav"> 93<a accesskey="p" href="pitfalls.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../foreach.html"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../function.html"><img src="../../../doc/src/images/next.png" alt="Next"></a> 94</div> 95</body> 96</html> 97