boostorg / phoenix

Boost.org phoenix module
http://boost.org/libs/phoenix
30 stars 46 forks source link

actor: Remove copy assignment operator #98

Closed Kojoley closed 4 years ago

Kojoley commented 4 years ago

In #64 when I made actor utilize Proto generated assignment operators, I missed that Phoenix copy assignment operator was not producing a lazy expression, instead it simply copied the state over. I do not know why that was done in the first place, the previous behavior is not logical to me, and the current one is more justified, however after thinking thoroughly there is not a lot of use cases for it, the only I had come with is:

#include <boost/phoenix.hpp>
#include <iostream>

int main()
{
  using namespace boost::phoenix;

  int i = 0, j = 123;
  auto ri = ref(i);
  (ri = ref(j))();
  std::cout << "i=" << i << ", j=" << j << "\n";
}

Since the behavior was broken 6 releases (2.5 years) ago, what is enough time to some one to spot the change and report a regression, but we have not received any, and the new behavior has a little value, I think it is better to simply remove the copy assignment operator, because it will allow us to solve naturally the issue with the -Wdeprecated-copy warning (otherwise we need either to define copy constructor and it will break code that relies on actor being an aggregate, or suppress the warning what currently impossible on GCC).

Closes #83 Closes #97

Kojoley commented 4 years ago

@djowel could you take a look, please? Beta is in less than three weeks, so the merge window is tight on this.

Kojoley commented 4 years ago

Please, merge to master branch

djowel commented 4 years ago

Please, merge to master branch

Done. Many thanks!