Skip to content

Commit

Permalink
fix non-constexpr path in span::size
Browse files Browse the repository at this point in the history
Reviewed By: Gownta, Mizuchi

Differential Revision: D62653433

fbshipit-source-id: 9420d40c1ca0666e53921cbae187746811d005ae
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Sep 14, 2024
1 parent 5631fdc commit 58f1574
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions folly/container/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct span_extent {
constexpr span_extent(span_extent const&) = default;
constexpr span_extent& operator=(span_extent const&) = default;

/* implicit */ operator std::size_t() const noexcept { return N; }
/* implicit */ constexpr operator std::size_t() const noexcept { return N; }
};

template <>
Expand All @@ -64,7 +64,9 @@ struct span_extent<dynamic_extent> {
constexpr span_extent(span_extent const&) = default;
constexpr span_extent& operator=(span_extent const&) = default;

/* implicit */ operator std::size_t() const noexcept { return extent; }
/* implicit */ constexpr operator std::size_t() const noexcept {
return extent;
}
};

/// span
Expand Down

0 comments on commit 58f1574

Please sign in to comment.