boostorg / random

Boost.org random module
http://boost.org/libs/random
34 stars 68 forks source link

boost/random/detail/polynomial.hpp:303:20: -Wdeprecated-copy warning #86

Open Kojoley opened 2 years ago

Kojoley commented 2 years ago
clang-linux.compile.c++ ../../../../bin.v2/libs/spirit/test/qi/qi_range_run.test/clang-linux-12/release/cxxstd-11-iso/stdlib-libc++/threading-multi/visibility-hidden/range_run.o
In file included from range_run.cpp:17:
In file included from ../../../../boost/random/mersenne_twister.hpp:32:
../../../../boost/random/detail/polynomial.hpp:303:20: error: definition of implicit copy constructor for 'reference' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
        reference &operator=(const reference &other)
                   ^
../../../../boost/random/detail/polynomial.hpp:315:16: note: in implicit copy constructor for 'boost::random::detail::polynomial::reference' first required here
        return reference(_storage[i/bits], i%bits);
               ^
jcstroud commented 1 month ago

I created a pull request to fix this issue: https://github.com/boostorg/random/pull/110

The fix is a simple, two line addition.

jcstroud commented 4 weeks ago

The previous fix did not pass all tests, seemingly because of backwards compatibility. I made a new, backwards compatible pull request here: https://github.com/boostorg/random/pull/111