[Boost-bugs] [Boost C++ Libraries] #4853: Actor is never assignable regardless of the template parameter

Subject: [Boost-bugs] [Boost C++ Libraries] #4853: Actor is never assignable regardless of the template parameter
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-11-14 15:55:23


#4853: Actor is never assignable regardless of the template parameter
-------------------------------------+--------------------------------------
 Reporter: neilgroves | Owner: hkaiser
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: spirit
  Version: Boost Development Trunk | Severity: Regression
 Keywords: actor assignable |
-------------------------------------+--------------------------------------
 On November 3, a user reported an issue using multiple Boost.Range
 adaptors upon a sequence. He produced code similar to this:

 struct Foo
 {
      Foo(const std::string& name, int value) : name_(name), value_(value)
        {
        }

        std::string name_;
        int value_;
 };

 typedef boost::shared_ptr<Foo> FooPtr;

 int range_test_complex()
 {
        typedef std::vector<FooPtr> V;

        V source;
        source +=
                boost::make_shared<Foo>("Foo", 10),
                boost::make_shared<Foo>("Bar", 20),
                boost::make_shared<Foo>("Baz", 30),
                boost::make_shared<Foo>("Baz", 30) // duplicate is
 here
                ;

        std::vector<std::string> result1;
        std::vector<int> result2;

        using namespace boost::adaptors;
        using phx::arg_names::arg1;

        boost::push_back(result1, source |
 transformed(phx::bind(&Foo::name_, *arg1)) | uniqued); // Fails

        boost::push_back(result2, source |
 transformed(phx::bind(&Foo::value_, *arg1)) | uniqued); // Fails

        return 0;
 }

 I investigated the issue and found that replacing the bind expressions
 solved the problem. The issue appears to have been introduced in revision
 57503 by a change intended to remove a warning about being unable to
 generate the assignment operator. I confirmed with the user that by
 commenting out line 143 in boost/spirit/home/pheonix/core/actor.hpp that
 the code compiled and worked as expected.

 Hence I believe that revision 57503 had the unintended consequence of
 making the actors non-assignable when they should be assignable.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4853>
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:04 UTC