4#ifndef TETL_FLAT_SET_FLAT_MULTISET_HPP
5#define TETL_FLAT_SET_FLAT_MULTISET_HPP
7#include <etl/_config/all.hpp>
9#include <etl/_algorithm/sort.hpp>
10#include <etl/_flat_set/sorted_equivalent.hpp>
11#include <etl/_functional/less.hpp>
12#include <etl/_iterator/reverse_iterator.hpp>
13#include <etl/_utility/move.hpp>
17template <
typename Key,
typename KeyContainer,
typename Compare =
less<Key>>
20 using value_type = Key;
21 using key_compare = Compare;
22 using value_compare = Compare;
23 using reference = value_type&;
24 using const_reference = value_type
const&;
25 using size_type =
typename KeyContainer::size_type;
26 using difference_type =
typename KeyContainer::difference_type;
27 using iterator =
typename KeyContainer::iterator;
28 using const_iterator =
typename KeyContainer::const_iterator;
29 using reverse_iterator =
etl::reverse_iterator<iterator>;
30 using const_reverse_iterator =
etl::reverse_iterator<const_iterator>;
31 using container_type = KeyContainer;
47 etl::sort(begin(), end(), _compare);
51 : _container(
etl::move(cont))
58 return _container.begin();
62 return _container.begin();
66 return _container.begin();
71 return _container.end();
73 [[
nodiscard]]
constexpr auto end()
const noexcept -> const_iterator
75 return _container.end();
79 return _container.end();
84 return _container.rbegin();
88 return _container.rbegin();
92 return _container.crbegin();
97 return _container.rend();
99 [[
nodiscard]]
constexpr auto rend()
const noexcept -> const_reverse_iterator
101 return _container.rend();
105 return _container.crend();
110 return _container.empty();
114 return _container.size();
118 return _container.max_size();
Definition adjacent_find.hpp:9
constexpr auto sorted_equivalent
Definition sorted_equivalent.hpp:13
Definition flat_multiset.hpp:18
constexpr auto crbegin() const noexcept -> const_reverse_iterator
Definition flat_multiset.hpp:90
constexpr auto rbegin() const noexcept -> const_reverse_iterator
Definition flat_multiset.hpp:86
constexpr flat_multiset(Compare const &comp)
Definition flat_multiset.hpp:38
constexpr auto rend() noexcept -> reverse_iterator
Definition flat_multiset.hpp:95
constexpr auto begin() noexcept -> iterator
Definition flat_multiset.hpp:56
constexpr auto end() noexcept -> iterator
Definition flat_multiset.hpp:69
constexpr auto begin() const noexcept -> const_iterator
Definition flat_multiset.hpp:60
constexpr auto cbegin() const noexcept -> const_iterator
Definition flat_multiset.hpp:64
constexpr flat_multiset()
Definition flat_multiset.hpp:33
constexpr auto empty() const noexcept -> bool
Definition flat_multiset.hpp:108
constexpr flat_multiset(sorted_equivalent_t, KeyContainer cont)
Definition flat_multiset.hpp:50
constexpr auto max_size() const noexcept -> size_type
Definition flat_multiset.hpp:116
constexpr auto end() const noexcept -> const_iterator
Definition flat_multiset.hpp:73
constexpr auto crend() const noexcept -> const_reverse_iterator
Definition flat_multiset.hpp:103
constexpr auto rend() const noexcept -> const_reverse_iterator
Definition flat_multiset.hpp:99
constexpr auto size() const noexcept -> size_type
Definition flat_multiset.hpp:112
constexpr auto cend() const noexcept -> const_iterator
Definition flat_multiset.hpp:77
constexpr flat_multiset(KeyContainer cont)
Definition flat_multiset.hpp:44
constexpr auto rbegin() noexcept -> reverse_iterator
Definition flat_multiset.hpp:82
Function object for performing comparisons. Unless specialised, invokes operator< on type T....
Definition less.hpp:15
Definition sorted_equivalent.hpp:9