Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Flast committed Sep 15, 2024
1 parent 515fff3 commit 1af78d4
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 94 deletions.
26 changes: 13 additions & 13 deletions flat_map/__binary_flat_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@ class _binary_flat_tree_base : private detail::comparator_store<Compare>
Container _container;

public:
using key_type = Key;
using value_type = typename Container::value_type;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using key_compare = Compare;
using allocator_type = typename Container::allocator_type;
using reference = typename Container::reference;
using const_reference = typename Container::const_reference;
using pointer = typename Container::pointer;
using const_pointer = typename Container::const_pointer;
using iterator = typename Container::iterator;
using const_iterator = typename Container::const_iterator;
using reverse_iterator = typename Container::reverse_iterator;
using key_type = Key;
using value_type = typename Container::value_type;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using key_compare = Compare;
using allocator_type = typename Container::allocator_type;
using reference = typename Container::reference;
using const_reference = typename Container::const_reference;
using pointer = typename Container::pointer;
using const_pointer = typename Container::const_pointer;
using iterator = typename Container::iterator;
using const_iterator = typename Container::const_iterator;
using reverse_iterator = typename Container::reverse_iterator;
using const_reverse_iterator = typename Container::const_reverse_iterator;
struct node_type
{
Expand Down
30 changes: 15 additions & 15 deletions flat_map/flat_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ class flat_map : private detail::_binary_flat_tree_base<flat_map<Key, T, Compare
static constexpr range_order_t<range_order::unique_sorted> _order{};

public:
using key_type = typename _super::key_type;
using mapped_type = T;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using key_type = typename _super::key_type;
using mapped_type = T;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using const_reverse_iterator = typename _super::const_reverse_iterator;
using node_type = typename _super::node_type;
using node_type = typename _super::node_type;
struct value_compare
{
protected:
Expand Down
30 changes: 15 additions & 15 deletions flat_map/flat_multimap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ class flat_multimap : private detail::_binary_flat_tree_base<flat_multimap<Key,
static constexpr range_order_t<range_order::sorted> _order{};

public:
using key_type = typename _super::key_type;
using mapped_type = T;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using key_type = typename _super::key_type;
using mapped_type = T;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using const_reverse_iterator = typename _super::const_reverse_iterator;
using node_type = typename _super::node_type;
using node_type = typename _super::node_type;
struct value_compare
{
protected:
Expand Down
30 changes: 15 additions & 15 deletions flat_map/flat_multiset.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ class flat_multiset : private detail::_binary_flat_tree_base<flat_multiset<Key,
static constexpr range_order_t<range_order::sorted> _order{};

public:
using key_type = typename _super::key_type;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using value_compare = key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using key_type = typename _super::key_type;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using value_compare = key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using const_reverse_iterator = typename _super::const_reverse_iterator;
using node_type = typename _super::node_type;
using node_type = typename _super::node_type;

private:
using _comparator = value_compare;
Expand Down
32 changes: 16 additions & 16 deletions flat_map/flat_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ class flat_set : private detail::_binary_flat_tree_base<flat_set<Key, Compare, C
static constexpr range_order_t<range_order::unique_sorted> _order{};

public:
using key_type = typename _super::key_type;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using value_compare = key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using key_type = typename _super::key_type;
using value_type = typename _super::value_type;
using size_type = typename _super::size_type;
using difference_type = typename _super::difference_type;
using key_compare = typename _super::key_compare;
using value_compare = key_compare;
using allocator_type = typename _super::allocator_type;
using reference = typename _super::reference;
using const_reference = typename _super::const_reference;
using pointer = typename _super::pointer;
using const_pointer = typename _super::const_pointer;
using iterator = typename _super::iterator;
using const_iterator = typename _super::const_iterator;
using reverse_iterator = typename _super::reverse_iterator;
using const_reverse_iterator = typename _super::const_reverse_iterator;
using node_type = typename _super::node_type;
using insert_return_type = typename _super::insert_return_type;
using node_type = typename _super::node_type;
using insert_return_type = typename _super::insert_return_type;

private:
using _comparator = value_compare;
Expand Down
40 changes: 20 additions & 20 deletions flat_map/tied_sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ class zip_iterator
std::tuple<Iterators...> _it;

public:
using difference_type = std::ptrdiff_t;
using value_type = tuple<typename std::iterator_traits<Iterators>::value_type...>;
using pointer = tuple<typename std::iterator_traits<Iterators>::pointer...>;
using reference = tuple<typename std::iterator_traits<Iterators>::reference...>;
using difference_type = std::ptrdiff_t;
using value_type = tuple<typename std::iterator_traits<Iterators>::value_type...>;
using pointer = tuple<typename std::iterator_traits<Iterators>::pointer...>;
using reference = tuple<typename std::iterator_traits<Iterators>::reference...>;
using iterator_category = std::common_type_t<typename std::iterator_traits<Iterators>::iterator_category...>;

public:
Expand Down Expand Up @@ -191,11 +191,11 @@ class unzip_iterator
Iterator _base;

public:
using difference_type = typename std::iterator_traits<Iterator>::difference_type;
using value_type = std::tuple_element_t<N, typename std::iterator_traits<Iterator>::value_type>;
using pointer = detail::copy_cv_t<value_type, typename std::iterator_traits<Iterator>::pointer>*;
// using reference = detail::copy_cv_t<value_type, std::remove_reference_t<typename std::iterator_traits<Iterator>::reference>>&;
using reference = decltype(std::get<N>(*std::declval<Iterator>()));
using difference_type = typename std::iterator_traits<Iterator>::difference_type;
using value_type = std::tuple_element_t<N, typename std::iterator_traits<Iterator>::value_type>;
using pointer = detail::copy_cv_t<value_type, typename std::iterator_traits<Iterator>::pointer>*;
// using reference = detail::copy_cv_t<value_type, std::remove_reference_t<typename std::iterator_traits<Iterator>::reference>>&;
using reference = decltype(std::get<N>(*std::declval<Iterator>()));
using iterator_category = typename std::iterator_traits<Iterator>::iterator_category;

public:
Expand Down Expand Up @@ -281,17 +281,17 @@ class tied_sequence
std::tuple<Sequences...> _seq;

public:
using value_type = std::tuple<typename Sequences::value_type...>;
using allocator_type = detail::fake_allocator<std::tuple<typename Sequences::allocator_type...>>;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using reference = std::tuple<typename Sequences::reference...>;
using const_reference = std::tuple<typename Sequences::const_reference...>;
using pointer = std::tuple<typename Sequences::pointer...>;
using const_pointer = std::tuple<typename Sequences::const_pointer...>;
using iterator = detail::zip_iterator<typename Sequences::iterator...>;
using const_iterator = detail::zip_iterator<typename Sequences::const_iterator...>;
using reverse_iterator = std::reverse_iterator<iterator>;
using value_type = std::tuple<typename Sequences::value_type...>;
using allocator_type = detail::fake_allocator<std::tuple<typename Sequences::allocator_type...>>;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using reference = std::tuple<typename Sequences::reference...>;
using const_reference = std::tuple<typename Sequences::const_reference...>;
using pointer = std::tuple<typename Sequences::pointer...>;
using const_pointer = std::tuple<typename Sequences::const_pointer...>;
using iterator = detail::zip_iterator<typename Sequences::iterator...>;
using const_iterator = detail::zip_iterator<typename Sequences::const_iterator...>;
using reverse_iterator = std::reverse_iterator<iterator>;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;

private:
Expand Down

0 comments on commit 1af78d4

Please sign in to comment.