aboutsummaryrefslogtreecommitdiff
path: root/src/span.h
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-07-19 20:53:08 +0200
committerMarcoFalke <falke.marco@gmail.com>2020-07-19 20:51:06 +0200
commitfa2ae0ac8d43086430a29c73940ad6b1cd129e96 (patch)
treec35d078d3544cb8b66b23353bd93e38744e6b2b9 /src/span.h
parentfa8a99258947a9ee3749fa472180542920cd471c (diff)
span: Add Span::empty() and use it in script/descriptor
Diffstat (limited to 'src/span.h')
-rw-r--r--src/span.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/span.h b/src/span.h
index 841f1eadf7..79f13c9203 100644
--- a/src/span.h
+++ b/src/span.h
@@ -151,6 +151,7 @@ public:
return m_data[m_size - 1];
}
constexpr std::size_t size() const noexcept { return m_size; }
+ constexpr bool empty() const noexcept { return size() == 0; }
CONSTEXPR_IF_NOT_DEBUG C& operator[](std::size_t pos) const noexcept
{
ASSERT_IF_DEBUG(size() > pos);