9 Commits

Author SHA1 Message Date
Ion Gaztañaga
0e675a241a Fix maybe uninitilized read warnings.
Fix initial allocation functions
2021-12-29 17:29:48 +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
16cada57ea Fixes #184 ("Issues with custom exceptions implementation") 2021-04-19 21:52:55 +02:00
Ion Gaztañaga
c476113411 Merge branch 'noexcept-swap' of https://github.com/palebedev/container into palebedev-noexcept-swap 2021-01-02 00:38:31 +01:00
Ion Gaztañaga
621cd3a0ab Avoid using inheriting constructors and initializer_list::cbegin/cend to be nicer with older compilers 2021-01-01 23:44:56 +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
ebcd0222b4 Integrate and adapt "devector's", from Thaler Benedek's implementation. 2020-08-10 00:16:58 +02:00