Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#4853 closed Bugs (fixed)

Actor is never assignable regardless of the template parameter

Reported by: Neil Groves Owned by: Hartmut Kaiser
Milestone: Boost 1.49.0 Component: spirit
Version: Boost Release Branch Severity: Regression
Keywords: actor assignable Cc:

Description

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.

Change History (4)

comment:1 by Hartmut Kaiser, 12 years ago

What platform does this error occur on?

comment:2 by Thomas Heller, 12 years ago

This is fixed in phoenix V3

comment:3 by Joel de Guzman, 12 years ago

Resolution: fixed
Status: newclosed

fixed in phoenix-2 as well. next time, please assign phoenix tickets either to me or thomas heller.

comment:4 by Stacee Murphy, 11 years ago

Milestone: To Be DeterminedBoost 1.49.0
Version: Boost Development TrunkBoost Release Branch

Hah, Italy demonstrators rally against Berlusconi

Note: See TracTickets for help on using tickets.