add support for containers without ctor with allocator argument

This commit is contained in:
2019-05-07 01:12:34 +07:00
parent be0e43857d
commit dab7140405
2 changed files with 6 additions and 2 deletions

View File

@@ -87,12 +87,14 @@ namespace flat_hpp
std::is_same<typename container_type::allocator_type, allocator_type>::value, std::is_same<typename container_type::allocator_type, allocator_type>::value,
"Container::allocator_type must be same type as allocator_type"); "Container::allocator_type must be same type as allocator_type");
public: public:
flat_map() = default;
explicit flat_map( explicit flat_map(
const Allocator& a) const Allocator& a)
: data_(a) {} : data_(a) {}
explicit flat_map( explicit flat_map(
const Compare& c = Compare(), const Compare& c,
const Allocator& a = Allocator()) const Allocator& a = Allocator())
: data_(a) : data_(a)
, compare_(c) {} , compare_(c) {}

View File

@@ -56,12 +56,14 @@ namespace flat_hpp
std::is_same<typename container_type::allocator_type, allocator_type>::value, std::is_same<typename container_type::allocator_type, allocator_type>::value,
"Container::allocator_type must be same type as allocator_type"); "Container::allocator_type must be same type as allocator_type");
public: public:
flat_set() = default;
explicit flat_set( explicit flat_set(
const Allocator& a) const Allocator& a)
: data_(a) {} : data_(a) {}
explicit flat_set( explicit flat_set(
const Compare& c = Compare(), const Compare& c,
const Allocator& a = Allocator()) const Allocator& a = Allocator())
: data_(a) : data_(a)
, compare_(c) {} , compare_(c) {}