Commit Graph

547 Commits

Author SHA1 Message Date
Mehdi Amini
40451e4bf7 Add variant of map constructors to avoid useless extra allocator copy when using initializer list
Many existing constructors have this form:

  map(std::initializer_list<value_type> il, const Compare& comp = Compare(), const allocator_type& a = allocator_type())

The issue is that a temporary allocator_type is constructed, and
passed to the base class where it is used to copy-constructed the
rebound allocator.
This temporary allocator_type here is always destroyed at the end
of the map() constructor. For stateful allocators this is not
desirable.
The solution is to adopt what libc++ is doing and have to constructors:

  map(std::initializer_list<value_type> il, const Compare& comp = Compare(), const allocator_type& a)

and

  map(std::initializer_list<value_type> il, const Compare& comp = Compare())

This way, unless an allocator is provided by the client, no extra temporary
creation/destruction occurs.
2017-05-08 12:39:06 -07:00
Ion Gaztañaga
6580c94573 Documentation fixes 2017-04-08 00:23:41 +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
a7e2bed8f1 Use adaptive_sort for merge operations. 2017-04-06 23:35:08 +02:00
Ion Gaztañaga
903b568d13 Split set/map tests as some compilers refuse to allocate too many sectios in the object file 2017-04-06 23:34:30 +02:00
Ion Gaztañaga
d6749960fc Implement extract_sequence and adopt_sequence for flat ordered associative containers 2017-04-05 16:06:31 +02:00
Ion Gaztañaga
cdb022fda2 Fix ambiguous constructor calls for piecewise_construct and Boost vs std tuples 2017-04-05 16:04:53 +02:00
Ion Gaztañaga
01d7c71ea8 Fix node_handle bugs:
-> Bad allocator destruction in swap
-> Wrong assertion in operator=
-> Make dangerous functions private

Added full testsuite.
2017-04-02 00:20:38 +02:00
Ion Gaztañaga
e919196b8c Fix GitHub Pull #46: "Fix use of propagate_on_container_swap" 2017-03-28 13:40:08 +02:00
Ion Gaztañaga
ab6e21494b Merge branch 'tsnorri-develop' into develop 2017-03-28 13:33:54 +02:00
Ion Gaztañaga
d08bceb6d9 Merge branch 'develop' of https://github.com/tsnorri/container into tsnorri-develop 2017-03-28 13:33:42 +02:00
Ion Gaztañaga
99488659ec Update changelog with ticket #12915 2017-03-28 12:51:33 +02:00
Ion Gaztañaga
4d05ce8738 Fix for Ticket #12915: "Buffer overflow in boost::container::vector (affects flat_set)" 2017-03-28 12:37:22 +02:00
Tuukka Norri
45b56d4361 Fix use of propagate_on_container_swap 2017-03-20 23:15:08 +02:00
Ion Gaztañaga
1261ac3308 Fix emplace_back return type also in compilers without variadic templates. Update changelog. 2017-02-24 22:07:20 +01:00
Ion Gaztañaga
a15e85d4db Merge branch 'think-cell-vector_emplace_back' into develop 2017-02-24 18:01:57 +01:00
Tobias Reh
5fe2dba504 emplace_back must return reference to back(), not to *end() 2017-02-24 15:33:30 +01: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
1404933491 Delete unused hash table 2017-02-06 11:50:53 +01:00
Ion Gaztañaga
23e9e8b494 Fix copyright notice. 2017-01-12 14:58:44 +01:00
Ion Gaztañaga
a5db65fc4a Merge branch 'zerotypos-found-inspection_report' into develop 2017-01-12 14:53:35 +01:00
Ion Gaztañaga
f71fee5140 Merge branch 'inspection_report' of https://github.com/zerotypos-found/container into zerotypos-found-inspection_report 2017-01-12 14:53:20 +01:00
Ion Gaztañaga
79f5977688 Fixes Ticket #12749 container::pmr::polymorphic_allocator compilation error 2017-01-12 14:49:31 +01:00
Ion Gaztañaga
38947de89c Update static vector project 2017-01-12 14:49:02 +01:00
Ion Gaztañaga
c0ccad469e Add constant for capacity in tests 2017-01-12 14:48:09 +01:00
Ion Gaztañaga
c0424f5330 Add BOOST_CONTAINER_FORCEINLINE 2017-01-12 14:46:06 +01:00
zerotypos-found
7cb3a6fbe8 [inspection report] remove tabs and fix copyright notice format 2016-12-20 11:03:57 +09:00
Ion Gaztañaga
82ac39fb42 Merge branch 'maksqwe-unused_variable' into develop 2016-11-26 14:54:25 +01:00
Ion Gaztañaga
8141dbcbe6 Merge branch 'unused_variable' of https://github.com/maksqwe/container into maksqwe-unused_variable 2016-11-26 14:40:38 +01:00
Ion Gaztañaga
5e4a107e82 Fixes Ticket #12534: flat_map fails to compile if included after type_traits is instantiated under gcc 2016-11-25 23:56:33 +01:00
Ion Gaztañaga
d3ea3468de Since null-reference warning with sanitizers 2016-11-20 18:17:08 +01:00
Maks Naumov
e7f452bf91 Remove unused local variable 2016-11-17 00:02:29 +02:00
Ion Gaztañaga
c54237a98b Update changelog for 1.63 2016-11-13 17:49:05 +01:00
Ion Gaztañaga
9522c0bc55 Merge branch 'think-cell-copy_move_algo__parameter_fix' into develop 2016-11-13 00:41:14 +01:00
Ion Gaztañaga
764fcd88bf Merge branch 'copy_move_algo__parameter_fix' of https://github.com/think-cell/container into think-cell-copy_move_algo__parameter_fix 2016-11-13 00:26:58 +01:00
Ion Gaztañaga
756c61be5b Merge branch 'mknejp-patch-1' into develop 2016-11-13 00:23:55 +01:00
Ion Gaztañaga
2e464aab32 Merge branch 'patch-1' of https://github.com/mknejp/container into mknejp-patch-1 2016-11-13 00:23:38 +01:00
Ion Gaztañaga
77f5d7218d Avoid reference to null errors in sanitizers 2016-11-12 23:55:03 +01:00
Ion Gaztañaga
c08943326f Merge branch 'develop' of github.com:boostorg/container into develop 2016-11-12 19:16:47 +01:00
Ion Gaztañaga
238f37db22 Remove duplicated forceinline in push_back overloads 2016-11-12 19:08:24 +01:00
Ion Gaztañaga
ede225c9d2 Disable forceinline for old compilers due to bugs. 2016-11-12 19:07:54 +01:00
Ion Gaztañaga
1f3174baa7 Make build_number_seq with O(logN) instantiations instead of O(N) 2016-11-12 19:07:34 +01:00
Ion Gaztañaga
0a719901b6 Avoid warnings of unused "piecewise_construct" 2016-11-12 19:06:44 +01:00
Ion Gaztañaga
d7bf947a4b Fix iterator_from_iiterator not value initializing its parent iterator 2016-11-12 19:06:23 +01:00
Miro Knejp
bf25231d5d Avoid -Wunreachable-code in do_allocate()
do_allocate() triggered the warning
"code will never be executed [-Wunreachable-code]"
in Clang.

Changed both do_allocate and do_deallocate to keep the existing
similarity.
2016-11-02 13:43:34 +01:00
Tobias Germer
3830745c9f Fix parameter types in copy_move_algo.hpp: iterator_traits::difference_type -> allocator_traits::size_type 2016-10-19 14:13:46 +02:00