Boost C++ Libraries: Ticket #10632: Problem with range transform with gcc-4.8 optimized https://svn.boost.org/trac10/ticket/10632 <p> With gcc4.8, if the option -O is used, the operation " | transformed(arg1)" on a transformed range leads to unexpected results. </p> <p> E.g. if "initialVec" is a vector containing any values, the following line gives a null resultVec:<br /> auto resultVec = initialVec | transformed( arg1 * 2 ) | transformed( arg1 ); </p> <p> This problem is also present with clang (optimized) and visual studio 2013 (in release), but not in debug modes, and not with gcc-4.6. </p> <p> Note that an operation in the second transformed remove this problem: the following code is working as expected:<br /> auto resultVec = initialVec | transformed( arg1 * 2 ) | transformed( arg1 * 1 ); </p> <p> This problem has been reproduced with boost 1.49, 1.55 and 1.56. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10632 Trac 1.4.3 Fabien Nendaz <fabien@…> Tue, 07 Oct 2014 15:54:49 GMT attachment set https://svn.boost.org/trac10/ticket/10632 https://svn.boost.org/trac10/ticket/10632 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">transform_pb.cpp</span> </li> </ul> <p> Minimal program to reproduce </p> Ticket