Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Make span default ctr and assignment be = default #4198

Merged
merged 2 commits into from
Mar 24, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/include/OpenImageIO/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ class span {
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
static constexpr size_type extent = Extent;

/// Default constructor -- the span points to nothing.
constexpr span () noexcept { }
/// Default constructor -- the span will be `{nullptr,0}`.
constexpr span () noexcept = default;

/// Copy constructor (copies the span pointer and length, NOT the data).
template<class U, oiio_span_size_type N>
Expand Down Expand Up @@ -143,11 +143,7 @@ class span {
: span (il.begin(), il.size()) { }

/// Assignment copies the pointer and length, not the data.
span& operator= (const span &copy) {
m_data = copy.data();
m_size = copy.size();
return *this;
}
constexpr span& operator= (const span &copy) = default;
lgritz marked this conversation as resolved.
Show resolved Hide resolved

/// Subview containing the first Count elements of the span.
template<size_type Count>
Expand Down
Loading