Skip to content

Commit

Permalink
Merge pull request #173 from elbeno/fix-container-return-types
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevalenty authored Nov 21, 2024
2 parents fd1e82e + c9ec853 commit 7cdfadd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions include/stdx/cx_map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,24 @@ template <typename Key, typename Value, std::size_t N> class cx_map {
: storage{vs...}, current_size{sizeof...(Vs)} {}

[[nodiscard]] constexpr auto begin() LIFETIMEBOUND -> iterator {
return std::begin(storage);
return std::data(storage);
}
[[nodiscard]] constexpr auto begin() const LIFETIMEBOUND -> const_iterator {
return std::begin(storage);
return std::data(storage);
}
[[nodiscard]] constexpr auto
cbegin() const LIFETIMEBOUND -> const_iterator {
return std::cbegin(storage);
return std::data(storage);
}

[[nodiscard]] constexpr auto end() LIFETIMEBOUND -> iterator {
return std::begin(storage) + current_size;
return begin() + current_size;
}
[[nodiscard]] constexpr auto end() const LIFETIMEBOUND -> const_iterator {
return std::begin(storage) + current_size;
return begin() + current_size;
}
[[nodiscard]] constexpr auto cend() const LIFETIMEBOUND -> const_iterator {
return std::cbegin(storage) + current_size;
return cbegin() + current_size;
}

[[nodiscard]] constexpr auto size() const -> std::size_t {
Expand Down
12 changes: 6 additions & 6 deletions include/stdx/cx_set.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,24 @@ template <typename Key, std::size_t N> class cx_set {
}

[[nodiscard]] constexpr auto begin() LIFETIMEBOUND -> iterator {
return std::begin(storage);
return std::data(storage);
}
[[nodiscard]] constexpr auto begin() const LIFETIMEBOUND -> const_iterator {
return std::begin(storage);
return std::data(storage);
}
[[nodiscard]] constexpr auto
cbegin() const LIFETIMEBOUND -> const_iterator {
return std::cbegin(storage);
return std::data(storage);
}

[[nodiscard]] constexpr auto end() LIFETIMEBOUND -> iterator {
return std::begin(storage) + current_size;
return begin() + current_size;
}
[[nodiscard]] constexpr auto end() const LIFETIMEBOUND -> const_iterator {
return std::begin(storage) + current_size;
return begin() + current_size;
}
[[nodiscard]] constexpr auto cend() const LIFETIMEBOUND -> const_iterator {
return std::cbegin(storage) + current_size;
return cbegin() + current_size;
}

[[nodiscard]] constexpr auto size() const -> size_type {
Expand Down
12 changes: 6 additions & 6 deletions include/stdx/cx_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,24 @@ template <typename T, std::size_t N> class cx_vector {
}

[[nodiscard]] constexpr auto begin() LIFETIMEBOUND -> iterator {
return std::begin(storage);
return std::data(storage);
}
[[nodiscard]] constexpr auto begin() const LIFETIMEBOUND -> const_iterator {
return std::begin(storage);
return std::data(storage);
}
[[nodiscard]] constexpr auto
cbegin() const LIFETIMEBOUND -> const_iterator {
return std::cbegin(storage);
return std::data(storage);
}

[[nodiscard]] constexpr auto end() LIFETIMEBOUND -> iterator {
return std::begin(storage) + current_size;
return begin() + current_size;
}
[[nodiscard]] constexpr auto end() const LIFETIMEBOUND -> const_iterator {
return std::begin(storage) + current_size;
return begin() + current_size;
}
[[nodiscard]] constexpr auto cend() const LIFETIMEBOUND -> const_iterator {
return std::cbegin(storage) + current_size;
return cbegin() + current_size;
}

[[nodiscard]] constexpr auto rbegin() LIFETIMEBOUND -> reverse_iterator {
Expand Down

0 comments on commit 7cdfadd

Please sign in to comment.