Commit Graph

718 Commits

Author SHA1 Message Date
Peter Dimov
13e73d6a78 Do not use UINT_MAX to avoid -Wmicrosoft-enum-value from Clang 2017-06-27 16:23:18 +03:00
Peter Dimov
20a517cc3d Clang/C2 doesn't have _mm_pause 2017-06-27 15:41:56 +03:00
Peter Dimov
0adb1fb212 Add shared_count constructor taking sp_counted_base* 2017-06-22 15:24:49 +03:00
Peter Dimov
2d087d0003 Do not use A::destroy in allocate_shared_noinit 2017-06-21 13:44:17 +03:00
Peter Dimov
81e1cfe301 Merge branch 'develop' into feature/local_shared_ptr 2017-06-21 03:04:16 +03:00
Glen Fernandes
4046186a2d Use BOOST_NOEXCEPT_OR_NOTHROW for get_deleter
throw() optimizes better there with older versions of GCC in C++98.
2017-06-20 19:27:58 -04:00
Peter Dimov
f901988e57 Store shared_count in local_counted_base, not shared_ptr 2017-06-20 21:38:03 +03:00
Peter Dimov
fb17bf685e Add more tests; fix errors 2017-06-20 20:38:26 +03:00
Peter Dimov
052ebd1946 Merge branch 'develop' into feature/local_get_deleter 2017-06-20 19:35:23 +03:00
Peter Dimov
028bb2cee8 Fix get_deleter in allocate_shared_array.hpp 2017-06-20 19:33:39 +03:00
Peter Dimov
6e5a382b6b Start work on get_deleter for local_shared_ptr 2017-06-20 19:01:16 +03:00
Peter Dimov
b104d85d95 Fix use of allocator_traits 2017-06-20 05:36:47 +03:00
Peter Dimov
2b5869882a Optimize make_local_shared to use a single allocation 2017-06-20 04:27:45 +03:00
Peter Dimov
6218c52c1a Add make_local_shared 2017-06-20 01:42:45 +03:00
Peter Dimov
edf02ab0f9 Add more tests 2017-06-19 01:05:01 +03:00
Peter Dimov
7ed8583a9c Document shared_ptr atomic access functions 2017-06-18 15:24:00 +03:00
Peter Dimov
6474847481 Make atomic_shared_ptr's default constructor constexpr 2017-06-18 07:56:42 +03:00
Peter Dimov
0e78e219f5 Make default constructors constexpr 2017-06-18 02:43:20 +03:00
Peter Dimov
67d897a533 Add a spinlock to atomic_shared_ptr 2017-06-17 23:37:18 +03:00
Peter Dimov
7bd389c95e Merge branch 'develop' into feature/local_shared_ptr 2017-06-17 00:15:39 +03:00
Peter Dimov
1cae5c5696 Fix documentation links in headers 2017-06-17 00:13:21 +03:00
Peter Dimov
369fdbe38d Merge branch 'develop' into feature/local_shared_ptr 2017-06-16 20:20:54 +03:00
Peter Dimov
a048cfb56d Minor fixes to atomic_shared_ptr.hpp 2017-06-16 20:19:37 +03:00
Peter Dimov
7484d4da41 Merge branch 'develop' into feature/local_shared_ptr 2017-06-16 18:40:01 +03:00
Peter Dimov
a7668291d2 Add atomic_shared_ptr 2017-06-16 18:26:17 +03:00
Peter Dimov
27898b0823 Constrain conversions to shared_ptr/weak_ptr 2017-06-13 20:57:12 +03:00
Peter Dimov
47ee1e09e9 Use single allocation in deleter and allocator constructors 2017-06-13 18:29:18 +03:00
Peter Dimov
4dda1b5fbb Add lsp_array_* tests 2017-06-13 18:03:01 +03:00
Peter Dimov
585de501da Embed local_counted_base in the deleter in the pointer case 2017-06-13 17:27:06 +03:00
Peter Dimov
1d314c5668 Make null unique_ptr convert to empty shared_ptr 2017-06-13 05:50:40 +03:00
Peter Dimov
52d976fde2 Use BOOST_SP_NOEXCEPT, BOOST_SP_NOEXCEPT_WITH_ASSERT 2017-06-12 18:06:54 +03:00
Peter Dimov
e75fa9329b Remove noexcept on ~local_counted_base for g++ 4.7 2017-06-12 15:53:16 +03:00
Peter Dimov
8f2e6d04de Add more tests 2017-06-12 00:19:07 +03:00
Peter Dimov
8d9c4df71a Add more tests 2017-06-11 20:35:51 +03:00
Peter Dimov
aeadd6aeff Initial commit of local_shared_ptr 2017-06-04 21:24:20 +03:00
Raphael Isemann
ba98b8c33f Reencoded a few headers that used Windows-1252 with UTF-8.
Nearly every header in the boost codebase is UTF-8, but here there
are a few headers which are using Windows-1252, which makes it impossible
for some tools to parse those files. This patch just reencodes them
with UTF-8 like the rest of the codebase. I checked that the name of the
author is still correct after this change.

No functional change intended.
2017-06-02 14:51:53 +02:00
Peter Dimov
b530ffcae5 Remove redundant check; add coment; include config.hpp 2017-05-27 03:01:34 +03:00
K. Noel Belcourt
7f42d987e7 Protect clang pragmas with BOOST_CLANG macro. 2017-05-26 12:33:59 -06:00
Glen Fernandes
33b18c7da0 Reformat (line wrap at 80 characters) 2017-05-02 08:12:25 -04:00
Glen Fernandes
6bdd3fde65 Add alternative sp_array_construct for trivially destructible case 2017-04-23 01:42:15 -04:00
Peter Dimov
3568e093bb Fix lwm_win32_cs.hpp for Clang 2017-04-16 21:38:29 +03:00
Glen Fernandes
71ef7850ab Add examples back to documentation 2017-03-13 10:59:58 -04:00
Glen Fernandes
650537da60 Update unit tests for make_unique 2017-03-06 08:36:57 -05:00
Glen Fernandes
6ef791c715 Rename identifiers in allocate and deallocate 2017-03-05 22:07:58 -05:00
Glen Fernandes
15ed558a29 Further simplify alignment logic in allocate 2017-03-05 21:39:22 -05:00
Glen Fernandes
106ada7770 Remove unnecessary helper function 2017-03-05 19:13:26 -05:00
Glen Fernandes
9f70f6619f Do not rely on size of type_with_alignment 2017-03-05 19:10:56 -05:00
Glen Fernandes
8c058dfeee Use BOOST_NOEXCEPT_OR_NOTHROW over BOOST_NOEXCEPT 2017-03-04 23:36:24 -05:00
Glen Fernandes
d1bb87d34e Remove the now unnecessary allocate hint parameter 2017-03-01 13:15:23 -05:00
Glen Fernandes
b42acf77b3 Only use allocator construct/destroy for value_type, not shared_count 2017-03-01 06:18:06 -05:00
Peter Dimov
1f9c63c34f Fix MSVC parsing problem in allocate_shared_array 2017-03-01 12:08:17 +02:00
Glen Fernandes
52fbf70879 Special case aligning up sizes and change integral constant style 2017-02-28 19:23:02 -05:00
Glen Fernandes
fb59cd574e Copy rebind allocator before impl destruct 2017-02-28 07:21:49 -05:00
Glen Fernandes
970e88897c Revise make_shared and allocate_shared for arrays 2017-02-28 03:47:09 -05:00
Paul Groke
3bb4e4d2df don't define BOOST_SP_HAS_SYNC for z/OS XL C/C++ compiler 2017-02-25 05:44:04 +01:00
Minmin Gong
d718d21d6b Fix compiling problems under ClangC2. 2017-02-05 15:51:42 -08:00
Chris Glover
3e2ac10e94 Add rvalue versions of static_pointer_cast, const_pointer_cast, dynamic_pointer_cast, reinterpret_pointer_cast.
Aligns with proposed addition to std:: here: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0390r0.htm
2016-12-11 15:38:34 -05:00
Peter Dimov
3e61a63f60 Use throw() in place of noexcept on msvc-11.0,12.0 for the standard nothrow traits 2016-11-08 18:42:51 +02:00
Peter Dimov
a7fbb0a841 Do not use components removed in C++17 (auto_ptr, binary_function) 2016-11-06 15:35:46 +02:00
Peter Dimov
5595622c3e Relax dynamic_cast check; rephrase const_cast test to be more MSVC-friendly. 2016-09-10 20:18:37 +03:00
Peter Dimov
2ae3e4ba44 Remove static_pointer_cast restriction; test dynamic cross cast. 2016-09-10 20:07:47 +03:00
Peter Dimov
a14515a364 Add negative pointer cast tests. 2016-09-10 18:43:22 +03:00
Peter Dimov
190c06e25d Add tests for unique_ptr casts. 2016-09-10 17:55:14 +03:00
Peter Dimov
62a8a9d6cc Merge branch 'karo/unique_ptr_casts' of https://github.com/koraa/smart_ptr into feature/unique_ptr_casts 2016-09-10 14:48:26 +03:00
Peter Dimov
48401806f4 Merge branch 'make_shared-constructor-forwarding' of https://github.com/muggenhor/boost-smart_ptr into develop 2016-09-10 14:24:52 +03:00
Peter Dimov
02de302774 Merge branch 'suppress-weak-vtables-warning' of https://github.com/Kojoley/smart_ptr into develop 2016-09-10 13:55:20 +03:00
Peter Dimov
840e9fc96e Apply MIPS16 patch from ticket #12418 2016-09-02 20:13:15 +03:00
Nikita Kniazev
70367e848e Suppress weak vtables warnings 2016-08-31 17:32:09 +03:00
Peter Dimov
20fedcff2c Use <atomic> by default when BOOST_NO_CXX11_HDR_ATOMIC is not defined 2016-08-28 21:28:21 +03:00
Giel van Schijndel
de38a735ea boost::make_shared: use Constructor Forwarding on C++03
Use Boost.Move's move emulation and documented Constructor Forwarding
technique to provide (partial) constructor forwarding on compilers that
don't support r-value references.

This allows constructing types taking movable-but-not-copyable types as
constructor arguments. Additionally it's generally more efficient for
movable-and-copyable types, but that's just a nice-to-have.
2016-07-25 15:02:57 +02:00
Karolin Varner
ce52fb1045 pointer_casts with move semantics for unique_ptr 2016-06-06 16:08:26 +02:00
Karolin Varner
6b787f1cec Add overloads for std::shared_ptr to pointer casts 2016-06-06 14:51:44 +02:00
Peter Dimov
e52905cf3c Add intrusive_ptr converting move assignment. 2016-05-17 18:43:41 +03:00
Peter Dimov
a7ade6f062 Remove unnecessary #ifdef 2016-05-17 18:34:18 +03:00
Peter Dimov
097d2e9bf9 Merge branch 'intrusive_ptr_move' of https://github.com/jtwang83/smart_ptr into develop 2016-05-17 18:29:29 +03:00
Peter Dimov
582eb63cb3 Merge pull request #18 from joachim-faulhaber/smart_ptr_patches_1_59_0
Warning fixes: Conversion and unused parameter warnings
2016-05-17 18:07:32 +03:00
Peter Dimov
da8de3e95b Merge pull request #19 from Lastique/patch-4
Make the default  intrusive_ptr constructor constexpr
2016-05-17 17:59:10 +03:00
Peter Dimov
522f6c1869 Add more aliasing move test cases, add alias move reset 2016-04-13 14:31:43 +03:00
Peter Dimov
cd8de9d4a6 Merge branch 'move-alias' of https://github.com/uecasm/smart_ptr into develop 2016-04-13 13:29:50 +03:00
Glen Fernandes
427124543b Use remove_reference in make_unique implementation 2016-02-19 08:09:25 -05:00
Peter Dimov
4473bf8ec2 Fix hash support for shared_ptr<T[]>, <T[N]> 2015-12-15 19:13:20 +02:00
Glen Fernandes
7a7ac4512e Fix formatting in headers and tests 2015-11-11 01:26:15 -05:00
Glen Fernandes
7af503d3bb Refactor make_unique implementations
Before the pending refactor of make_shared/allocate_shared for arrays.
2015-11-08 11:02:06 -05:00
Ion Gaztañaga
3f17244225 Removed the intrin.h-related part
Removed the commented part as the comment clearly says that VC9 has problems when intrin.h is included.
2015-10-18 19:44:17 +02:00
Ion Gaztañaga
ca93749614 Support MSVC-7.1/ intrin.h available >= MSVC-8.0
-> MSVC 7.1 has no intrin.h and needs to use "#pragma intrinsic".
-> intrin.h available since Visual 2005
2015-10-18 12:51:13 +02:00
Gavin Lambert
05d5a4e9a0 Added shared_ptr aliasing move constructor.
Signed-off-by: Gavin Lambert <github@mirality.co.nz>
2015-10-12 18:19:22 +13:00
Andrey Semashev
970a179ac2 Make the default constructor constexpr 2015-10-05 18:24:52 +03:00
Joachim Faulhaber
fd543d3292 Warning fixes: Conversion and unused parameter warnings 2015-09-24 14:53:40 +02:00
Peter Dimov
df90496583 Disable deprecation warnings on g++/clang 2015-09-10 23:45:47 +03:00
jzmaddock
abbe975e8f Disable explicit operator bool on Oracle C++
Although Oracle supports this syntax, advanced usage such as:

if(my_shared_ptr && x)

Fail.  Attempts to wokaround by adding additional operator overloads have so far failed.
2015-08-18 18:14:50 +01:00
Edward Diener
686efe100b Updated Sleep declaration only includes _mingw.h when needed. 2015-07-22 18:23:43 -04:00
Edward Diener
acb880d8c2 Change to Sleep declaration for clang on Windows to match Windows implementation being used 2015-07-22 06:51:49 -04:00
Edward Diener
1712b87cb6 Added __declspec(dllimport) for Sleep using clang on Windows. 2015-07-21 15:41:35 -04:00
Peter Dimov
a42dda0af4 Apply fix for errata 754327 for ARM Cortex-A9 suggested in ticket #11362 2015-06-06 01:40:01 +03:00
Peter Dimov
d875a68ceb Add constructor/assignment taking boost::movelib::unique_ptr 2015-05-04 01:06:42 +03:00
Jörg Böhme
94824c807f Add missing std:: namespace 2015-03-20 00:23:58 +01:00
Jonathan Wang
334654de06 intrusive_ptr: add converting ctor for intrusive_ptr<U> with move semantics. Analagous to
template <class U> intrusive_ptr(intrusive_ptr<U> const&)
2015-03-15 20:17:55 -04:00
Fedor Sergeev
99762e7dde Add <cstddef> include. fixes #11066 2015-03-01 23:14:28 +04:00
Peter Dimov
7104e7dc7e Add weak_from_this. 2015-01-25 20:10:57 +02:00
Peter Dimov
3fd53ced83 Make shared_from_raw and weak_from_raw return consistent values in a constructor, regardless of order, as suggested by Gavin Lambert in #8. 2015-01-22 20:47:01 +02:00