aboutsummaryrefslogtreecommitdiffstats
path: root/common/alspan.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-08-18 23:26:49 -0700
committerChris Robinson <[email protected]>2019-08-18 23:26:49 -0700
commita9223ae601c45c6bdc3c3001ce7b5f30141046b1 (patch)
treee55fd7786954a8f165063d375de4c0d718fe710c /common/alspan.h
parent2bbdd329cd6e1ea08f240f5420edadb076134302 (diff)
Improve subspan default template argument
Diffstat (limited to 'common/alspan.h')
-rw-r--r--common/alspan.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/alspan.h b/common/alspan.h
index 60a2bc4a..6a43b32a 100644
--- a/common/alspan.h
+++ b/common/alspan.h
@@ -249,9 +249,9 @@ public:
constexpr span last(size_t count) const
{ return (count >= size()) ? *this : span{mDataEnd-count, mDataEnd}; }
- template<size_t O, size_t C>
+ template<size_t O, size_t C=dynamic_extent>
constexpr span<element_type,C> subspan() const
- { return span<element_type,C>{mData+O, C}; }
+ { return span<element_type,C>{mData+O, (C!=dynamic_extent) ? mData+C : mDataEnd}; }
constexpr span subspan(size_t offset, size_t count=dynamic_extent) const
{