Skip to content

Commit

Permalink
Add member types based on std::span.
Browse files Browse the repository at this point in the history
  • Loading branch information
BrendanKKrueger committed Sep 13, 2024
1 parent 8e47f7b commit 61fcc48
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ports-of-call/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ class span {
std::size_t size_{0};

public:
// Member types
using element_type = T;
using value_type = std::remove_cv_t<T>;
using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
using pointer = T*;
using const_pointer = const T*;
using reference = T&;
using const_reference = const T&;
using iterator = T*;
using reverse_iterator = std::reverse_iterator<iterator>;

// Construct an empty span
PORTABLE_FUNCTION constexpr span() = default;

Expand Down

0 comments on commit 61fcc48

Please sign in to comment.