82 Commits

Author SHA1 Message Date
Ion Gaztañaga
dad2cb2d02 Support GCC's -Wconversion -Wfloat-conversion -Warith-conversion -Wsign-conversion warnings. 2021-10-16 15:57:47 +02:00
Ion Gaztañaga
d6a270e8e1 Correct "throws" part of several operations as the library by default throws its own exception types. 2021-01-02 16:24:37 +01:00
Pavel A. Lebedev
cb1e6af53d Add conditional noexcept forwarding from free to member swap functions.
This allows std::is_nothrow_swappable{,_with} to work properly.
This only touches user-facing classes, with the following exceptions:
- map,set: only doc changes (with a drive-by missing semicolon fix),
  detail::tree which they derive from already forwards noexcept for swap.
- flat_set: only doc changes for flat_set and a change for
  detail::flat_tree, which it derives from to get swap.
- static_vector: while this adds the forwarding, member static_vector::swap
  is currently never noexcept, although it could be for noexcept-swappable
  and noexcept-move-constructible elements.
- small_vector: there is no free swap, and member swap is never noexcept,
  although it could be for noexcept-swappable and noexcept-move-
  constructible elements. Swapping small_vectors of exact same type goes
  through std::swap, which seems to get noexcept right, and small_vectors
  of different sizes use swap for boost::container::vector, which fails
  to detect when such swap could be noexcept. This patch doesn't touch
  small_vector.
- scoped_allocator: neither member nor free swap are noexcept, although
  they should be, and all other constructions/assignments/comparisons too,
  as they only forward these operations to underlying allocators, which
  are required to not throw exceptions for them. Only static_vector's
  static_storage_allocator might throw for these and it shouldn't appear
  in scoped_allocator. Unsure of the scope of changes needed or whether it
  is even worth it, this patch doesn't touch scoped_allocator.
2020-12-30 08:28:06 +03:00
Ion Gaztañaga
2a458005d9 Fixes #171 ("deque::clear() uses undefined behaviour") 2020-11-10 10:08:03 +01:00
Ion Gaztañaga
0a0ad0009e Add support for [[nodiscard]]:
- Decorate container and allocator functions.
- Make sure to disable warnings in tests
- Update doxygen documentation to support it
2020-11-05 14:24:35 +01:00
Robert Leahy
d4a0917821 RandomAccessIterator + 0
Previously the iterators of boost::container::deque would assert when
zero was added to them in at least the following situations:

- The iterator was obtained by a call to boost::container::deque::begin
  and boost::container::deque::empty returns true
- The iterator was default constructed

This is inconsistent with the way in which the iterators of boost::
container::deque have behaved historically and is also inconsistent
with an understanding of iterators developed by analogy with pointers:

- Adding zero to a null pointer is valid despite the fact the null
  pointer cannot be dereferenced
- Adding zero to a pointer that is one past the end yields a pointer
  which is still one past the end and thus which has well defined
  semantics

Fixed this issue and codified the expected behavior in unit tests.
2019-12-22 20:03:57 -05:00
Mitsuru Kariya
f25c767a2b Fix has_trivial_destructor_after_move
Most template type parameters 'Allocator' were modified their default type to void since 1.70.0.
These modifications cause has_trivial_destructor_after_move to compile error or yield wrong result.
So, fix them by changing specializations of has_trivial_destructor_after_move.
2019-06-01 22:36:54 +09:00
Ion Gaztañaga
1e9b4a15eb Documentation fixes for options 2019-05-09 22:14:57 +02:00
Ion Gaztañaga
5f0ce60b39 Fixes #88 ("Implement C++17 MoveAssignable requirements for self-move assignments") 2019-04-30 18:05:50 +02:00
Ion Gaztañaga
24e420abe9 Add block size customization options to deque. 2019-04-28 19:18:22 +02:00
Ion Gaztañaga
7efea237e1 Add forceinline to trivial cases 2019-03-30 12:32:39 +01:00
Ion Gaztañaga
da21340323 Fix #105 ("Fix gcc -Wdeprecated-copy") 2019-03-05 12:15:42 +01:00
Ion Gaztañaga
2b3775985e Add BOOST_CONTAINER_FORCEINLINE 2019-03-05 12:11:43 +01:00
Ion Gaztañaga
83bb62fed3 Default allocator parameter changed form new_alloator<T> to void to reduce symbol lenghts 2019-01-10 22:54:58 +01:00
Ion Gaztañaga
cb21746b80 Rewrite CTAD and SFINAE-out overloads as the standard requires 2018-11-12 22:52:45 +01:00
Ion Gaztañaga
9a22431578 * Clean up constructor template auto deduction guides to use Boost.Container traits
* GitHub #73: '"triviality of pair".

* Fixed race condition bug in unsynchronized_pool_resource
2018-06-14 13:17:55 +02:00
Richard Powell
72195ae288 Adding Constructor Template Auto Deduction guides. 2018-05-11 11:35:25 -06:00
Ion Gaztañaga
fa2494631a Use namespace dtl instead of container_detail to avoid excessively long symbol names. 2017-11-07 00:51:46 +01:00
Ion Gaztañaga
1d727753e2 Use directly boost::movelib::to_raw_pointer/iterator_to_raw_pointer 2017-04-07 16:07:00 +02:00
Ion Gaztañaga
0617d0e538 Implemented P0084R2 (Emplace Return Type) 2016-08-29 16:53:44 +02:00
Ion Gaztañaga
649aba461e Fixes Trac #12296 ("boost::container::{deque,string} combine for a memory leak"). The use of trivial_destructor_after_move was incorrect in several contexts. 2016-08-02 00:49:38 +02:00
Ion Gaztañaga
225e2da77e Revised noexcept expressions of default and move constructors in all containers. 2016-08-01 23:49:51 +02:00
Ion Gaztañaga
873daf9a0c Fixed bug Trac #11170 2016-05-13 22:17:03 +02:00
Ion Gaztañaga
c894ddf5a5 Use SFINAE in range constructors to detect iterators 2015-12-25 13:24:27 +01:00
Ion Gaztañaga
7764e05444 Changes to support GCC 3.4 2015-10-12 18:51:08 +02:00
Ion Gaztañaga
85b2ed509b Added debug assertions via BOOST_ASSERT to check preconditions in several members. All checks are O(1) 2015-09-18 14:39:17 +02:00
Ion Gaztañaga
6477543f3b Updated to new meta-functions reused from Intrusive/Move 2015-04-14 15:21:46 +02:00
Ion Gaztañaga
c2ea5da716 Fix move constructors with unequal allocators and move/copy assignment of tree. 2015-02-26 00:22:23 +01:00
Ion Gaztañaga
22f1d32f7b Addd new constructors to containers, according to C++14's new constructors taking allocator arguments. 2015-02-03 14:08:29 +01:00
Ion Gaztañaga
10d027aa9c Include boost/config.hpp before testinG BOOST_HAS_PRAGMA_ONCE. 2015-02-02 15:26:53 +01:00
Ion Gaztañaga
b786c8f716 Replaced BOOST_CONTIANER_NOEXCEPT with BOOST_NOEXCEPT 2015-01-28 22:11:00 +01:00
Ion Gaztañaga
9fede24d7e Replace BOOST_MOVE_IMPDEF with BOOST_CONTAINER_IMPDEF 2015-01-26 00:33:40 +01:00
Ion Gaztañaga
ef7137a945 Replace BOOST_MOVE_IMPDEF with BOOST_CONTAINER_IMPDEF 2015-01-26 00:30:01 +01:00
Ion Gaztañaga
cb732a22be Replace BOOST_MOVE_IMPDEF with BOOST_CONTAINER_IMPDEF 2015-01-26 00:14:35 +01:00
Ion Gaztañaga
dbafd61d4d updated move assignments and swap operations to "N4258: Cleaning-up noexcept in the Library, Rev 3" with some customizations. 2015-01-19 00:18:44 +01:00
Ion Gaztañaga
37db43b697 Try to fix MSVC12 warnings of uninitialized variables when using no exception macros. 2015-01-17 17:35:05 +01:00
Ion Gaztañaga
a322203a89 Replaced _MSC_VER with BOOST_HAS_PRAGMA_ONCE before #pragma once. 2015-01-10 12:50:17 +01:00
Ion Gaztañaga
a369e3c8c5 Avoid instantiating iterator tags to allow iterators that define iterator_categories with forward declared tags. 2015-01-04 02:29:15 +01:00
Ion Gaztañaga
360957a797 Massive dependency reduction. Removed dependency on several boost libraries and standard C++ headers. 2015-01-02 19:34:21 +01:00
Ion Gaztañaga
955248b739 Replace "Allocator" template parameter with "A", according to the standard. 2014-12-11 22:01:58 +01:00
Ion Gaztañaga
32418cab5f Use boost::adl_move_swap instead of custom swap or std::swap for performance and compatibility reasons. 2014-11-28 15:41:44 +01:00
Ion Gaztañaga
7971dc6602 Refactored uses of <iterator> and <algorithm> to avoid dependencies where possible. 2014-11-26 07:08:06 +01:00
Ion Gaztañaga
d514c1ab66 Refactored comparison functors to reuse compare_functors.hpp classes 2014-11-23 10:07:12 +01:00
Ion Gaztañaga
6f1f162cb3 - Added nth and index_of.
- Used BOOST_MOVE_BASE
2014-11-01 20:03:25 +01:00
Ion Gaztañaga
d19b012d53 Reduced include dependencies:
- Replaced boost/move/move.hpp with boost/move/utility_core.hpp
- Replaces <new> with placement_new.hpp
- Removed some unneeded std includes.
2014-09-26 08:12:40 +02:00
Ion Gaztañaga
3af96e0801 Implements N3644.
- Avoid deriving from std::iterator_traits as iterators become too fat.
- Use intrusive's reverse_iterator some std::reverse_iterator-s don't value initialize base.
2014-09-24 16:09:56 +02:00
Ion Gaztañaga
3025cc41b6 Replace "boost/move/utility.hpp" with "boost/move/utility_core.hpp" to minimize dependencies. 2014-09-17 23:36:23 +02:00
Ion Gaztañaga
f213f55f20 Includes: Updated detail/xxx.hpp includes to core/xxx.hpp, added some missing move/traits.hpp and removed some unused ones. 2014-09-17 21:49:47 +02:00
Robert Matusewicz
f8ebfa472a Add std::initializer_list to the following containers:
* deque
* map
* multimap
* set
* multiset
* list
* slist

Tested on clant and g++
2014-08-27 17:34:25 +02:00
Ion Gaztañaga
a166923e83 Fixed documentation errors with "position", "pos", "hint" and "p" iterators indicating insertion/emplace position. 2014-08-15 17:20:57 +02:00