Skip to content

Commit

Permalink
Merge branch 'pull-request/#1007-Fix-fixed-extent-span-empty()' into …
Browse files Browse the repository at this point in the history
…development

# Conflicts:
#	.gitignore
  • Loading branch information
jwellbelove committed Jan 5, 2025
2 parents 8f70a3c + de51170 commit 8d352bb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/etl/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ namespace etl
//*************************************************************************
ETL_NODISCARD ETL_CONSTEXPR bool empty() const ETL_NOEXCEPT
{
return false;
return Extent == 0;
}

//*************************************************************************
Expand Down
4 changes: 4 additions & 0 deletions test/test_span_fixed_extent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ namespace
typedef etl::span<int, 10U> View;
typedef etl::span<int, 9U> SView;
typedef etl::span<const int, 10U> CView;
typedef etl::span<int, 0U> EView;

#if ETL_USING_CPP20
using StdView = std::span<int, 10U>;
Expand Down Expand Up @@ -484,6 +485,9 @@ namespace
{
View view1(etldata.begin(), etldata.begin());
CHECK(!view1.empty());

EView view2(etldata.begin(), etldata.begin());
CHECK(view2.empty());
}

//*************************************************************************
Expand Down

0 comments on commit 8d352bb

Please sign in to comment.