Commit Graph

8 Commits

Author SHA1 Message Date
Andrey Semashev
406228d493 Made initializing constructor of atomic<> implicit.
This is an attempt to make boost::atomic<> interface closer to the standard. It
makes a difference in C++17 as it mandates copy elision, which makes this code
possible:

  boost::atomic<int> a = 10;

It also makes is_convertible<T, boost::atomic<T>> return true, which has
implications on the standard library components, such as std::pair.

This removes the workaround for gcc 4.7, which complains that
operator=(value_arg_type) is considered ambiguous with operator=(atomic const&)
in assignment expressions, even though conversion to atomic<> is less preferred
than conversion to value_arg_type. We try to work around the problem from the
operator= side.

Added a new compile test to check that the initializing constructor is implicit.
2018-02-20 01:39:52 +03:00
Andrey Semashev
11c785768c Updated to reflect changes from P0558R1 accepted into C++17.
1. Expose value_type and difference_type (where present) to user's code.

2. Prohibit arithmetic operations on pointers to non-object types. In
   particular, arithmetic operations such as fetch_add/fetch_sub will no longer
   compile for pointers to cv void, pointers to functions and pointers to
   non-static class members.

Also, use C++11 <type_traits> when possible instead of Boost.TypeTraits to
reduce dependencies. Cleaned up value_arg_type internal type usage for more
efficient argument passing.
2017-04-01 18:29:26 +03:00
Andrey Semashev
7b1d722d94 Ported tests to core/lightweight_test.hpp.
Boost.Test was dropped due to instability and long-standing differences between develop and master branches. We don't use most of its features anyway.
2015-01-25 18:50:58 +03:00
Jürgen Hunold
30f72c8d25 Add explicit dependency on Boost.Test 2015-01-14 16:13:41 +01:00
Andrey Semashev
313497c6ae Added Windows version specification to fix compilation with MSVC. The code targets for Windows 2000. 2014-06-09 01:18:38 +04:00
Andrey Semashev
0c9b1b3806 Reworked platform selection, fixed Windows backend.
Platform selection now works in two stages. First compiler is tested for
the supported configuration. If that fails, OS is tested. Lastly, if
nothing succeeded, emulation backend is selected.
2014-06-09 01:07:26 +04:00
Andrey Semashev
6dc50f685c Merged recent changes from trunk.
[SVN r85604]
2013-09-08 13:55:41 +00:00
Andrey Semashev
b5da965c5b Boost.Atomic and Boost.Lockfree merged from trunk.
[SVN r81976]
2012-12-15 18:28:27 +00:00