[Boost-bugs] [Boost C++ Libraries] #5875: local variable in phoenix let discards value

Subject: [Boost-bugs] [Boost C++ Libraries] #5875: local variable in phoenix let discards value
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-09-08 09:14:37


#5875: local variable in phoenix let discards value
---------------------------------------+------------------------------------
 Reporter: Lars Viklund <zao@…> | Owner: theller
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: phoenix
  Version: Boost Development Trunk | Severity: Problem
 Keywords: phoenix local let |
---------------------------------------+------------------------------------
 In the following test case, the size of the vector is zero, while it
 should be three as that's what the vector is constructed with.

 {{{#!c++
 #include <boost/phoenix.hpp>
 #include <iostream>
 #include <vector>

 namespace phx = boost::phoenix;

 int main()
 {
         std::vector<int> v = phx::let(phx::local_names::_a =
 std::vector<int>(3))
         [
                 phx::local_names::_a
         ]
         ();
         std::cerr << v.size() << std::endl;
 }
 }}}

 If the local is used in a non-trivial way in the let block, the vector
 will be properly initialized.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5875>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC