90 Commits

Author SHA1 Message Date
Ion Gaztañaga
f5b2c7ba74 Fixes #214: ("string is not properly null-terminated in assignments") 2022-03-06 22:37:41 +01:00
Ion Gaztañaga
ec73bd71e1 Fix -Wshadow warnings 2021-12-29 17:30:15 +01:00
Ion Gaztañaga
3f76f9fdf7 Fixes #206 ("operator-> on static_vector::iterator causes cast alignment warning") 2021-12-28 15:17:15 +01:00
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
bcd41a1c64 - Add BOOST_CONTAINER_FORCEINLINE to trivial string internal functions
- Fixes #192 ("basic_string::clear() has poor codegen compared to STL implementations")
2021-09-13 14:19:38 +02:00
Ion Gaztañaga
482f0911e1 Use #include <boost/intrusive/detail/hash_combine.hpp> instead of #include <boost/container_hash/hash.hpp> to avoid pulling unneeded STL headers. 2021-01-05 00:07:02 +01:00
Ion Gaztañaga
95538bfdc2 Update static assert test and remove unneeded <string> include. 2021-01-02 22:47:19 +01:00
Ion Gaztañaga
2bd1a6f906 Add find_end algorithm and use it in string. 2021-01-02 17:03:15 +01:00
Ion Gaztañaga
5430c15ad9 Correct includes: <algorithm> is not used and <string> is needed for char_traits 2021-01-02 16:25:25 +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
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
Ion Gaztañaga
79ae525967 Fixes #133 ("basic_string move constructor with allocator argument has incorrect allocator check") 2019-11-14 15:25:22 +01: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
5f0ce60b39 Fixes #88 ("Implement C++17 MoveAssignable requirements for self-move assignments") 2019-04-30 18:05:50 +02: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
luz.paz
a6ac16d0c4 container: misc-typos
Found via `codespell -q 3 -L iff,nd`
2018-09-23 15:54:39 -04:00
Ion Gaztañaga
72c7ef7801 Fix assertion produced by previous string changes to avoid UB. 2018-09-18 14:23:31 +02:00
Ion Gaztañaga
cce2ef763a Improve short/long representation to avoid aliasing problems and disable "-Wmaybe-uninitialized" for compilers that have false positives. 2018-09-15 01:10:50 +02: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
f0736ba73a Use new "data" member char array in aligned_storage::type for placement new, to avoid breaking strict aliasing. 2018-01-30 14:20:52 +01:00
Ion Gaztañaga
2802a1f50d - Add configuration options to vector
- Cleanup tree configuration options
2017-12-10 23:33:41 +01: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
f49e5d0ad1 Fixes #59 2017-10-20 00:32:09 +02:00
Ion Gaztañaga
2a7b5a70a5 Closes #58 ("Comparing strings does not compile in gcc 7+ in C++17 mode") 2017-10-19 21:53:37 +02:00
Ion Gaztañaga
d5aede745e Unify std::binders and lambdas with custom binders 2017-05-26 22:31:26 +02:00
Daniela Engert
36c334f414 replace deprecated/removed C++98 binders by equivalent lambda expressions.
Signed-off-by: Daniela Engert <dani@ngrt.de>
2017-04-28 19:15:58 +02:00
Ion Gaztañaga
3516da36b0 Doxygen documentation fixes 2017-04-08 00:17:23 +02: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
ce5996c9bd Cosmetic indentation 2017-02-23 19:55:41 +01:00
Ion Gaztañaga
08cce5ebe5 Update basic_string with missing C++11 and C++17 interfaces:
- Default npos arguments in append, insert, compare
- Initializer list support
- Non-const data()
2017-02-21 23:08:11 +01:00
Ion Gaztañaga
865c69bab7 Changed string_view interoperability to a templated solution in order to support also std::string_view.
Added missing members and testcases.
2017-02-21 14:27:18 +01:00
Marshall Clow
fde7e1fbdd Add support for boost::string_view into container::basic_string
Conversion from a `basic_string` to a `string_view`, and make all the comparisons work.

Ion - if you like this, I'll work up some tests, too.
2017-02-13 11:35:27 -08: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
2a04243de7 Add safety assertion 2016-06-25 11:05:07 +02:00
Ion Gaztañaga
b888d2ae47 Fixes Trac #12183 (GCC 6.1 thinks boost::container::string violates strict aliasing) 2016-05-16 16:59:25 +02:00
Ion Gaztañaga
3f4a5dec6e Add some C++1 missing functions to string and a couple of debug assertions 2015-09-18 14:38:38 +02:00
Ion Gaztañaga
c6a5f248c8 Separated constructors of default constructed allocators 2015-09-07 19:07:05 +02:00
Ion Gaztañaga
4f9d397507 Simplified swapping 2015-06-04 11:42:27 +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
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
a322203a89 Replaced _MSC_VER with BOOST_HAS_PRAGMA_ONCE before #pragma once. 2015-01-10 12:50:17 +01:00
Ion Gaztañaga
37578ccaa2 New header, minimal_char_traits_header.hpp, to avoid including <string> to use char_traits when possible. 2015-01-04 02:30:57 +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