Skip to content

Commit

Permalink
Merge pull request #112 from LORD-MicroStrain/firmware
Browse files Browse the repository at this point in the history
Tweak: make Span copyable/movable
  • Loading branch information
microstrain-sam authored Oct 28, 2024
2 parents 7a72ec3 + d19374f commit 685e1d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cpp/microstrain/common/span.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ struct Span
using const_pointer = const T*;
using const_reference = const T&;

Span(pointer ptr) : m_ptr(ptr) {}
constexpr Span(pointer ptr) : m_ptr(ptr) {}

constexpr pointer begin() const noexcept { return m_ptr; }
constexpr pointer end() const noexcept { return m_ptr+extent; }
Expand All @@ -60,7 +60,7 @@ struct Span
[[nodiscard]] constexpr Span<T, Count == DYNAMIC_EXTENT ? DYNAMIC_EXTENT : Extent-Count> subspan() const { return {m_ptr+Offset}; }

private:
const pointer m_ptr = nullptr;
pointer m_ptr = nullptr;
};


Expand Down Expand Up @@ -100,8 +100,8 @@ struct Span<T, DYNAMIC_EXTENT>
[[nodiscard]] constexpr Span<T, Count> subspan() const { return {m_ptr+Offset, Count}; }

private:
pointer const m_ptr = nullptr;
size_t const m_cnt = 0;
pointer m_ptr = nullptr;
size_t m_cnt = 0;
};


Expand Down

0 comments on commit 685e1d8

Please sign in to comment.