Skip to content

Commit

Permalink
For GCC10, we should check __cplusplus >= 201709L when determining if…
Browse files Browse the repository at this point in the history
… c++20 is supported (#949)
  • Loading branch information
schemborerik authored and John Wellbelove committed Aug 31, 2024
1 parent c54ba6f commit 77ab40a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
20 changes: 10 additions & 10 deletions include/etl/multi_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ namespace etl
//*************************************************************************
/// Constructor.
//*************************************************************************
ETL_CONSTEXPR multi_span(span_list_type span_list_)
ETL_CONSTEXPR14 multi_span(span_list_type span_list_)
: span_list(span_list_)
{
}
Expand All @@ -209,7 +209,7 @@ namespace etl
/// data() and size() member functions.
//*************************************************************************
template <typename TContainer>
ETL_CONSTEXPR multi_span(TContainer& a) ETL_NOEXCEPT
ETL_CONSTEXPR14 multi_span(TContainer& a) ETL_NOEXCEPT
: span_list(a.data(), a.data() + a.size())
{
}
Expand All @@ -219,7 +219,7 @@ namespace etl
/// data() and size() member functions.
//*************************************************************************
template <typename TContainer>
ETL_CONSTEXPR multi_span(const TContainer& a) ETL_NOEXCEPT
ETL_CONSTEXPR14 multi_span(const TContainer& a) ETL_NOEXCEPT
: span_list(a.data(), a.data() + a.size())
{
}
Expand All @@ -228,7 +228,7 @@ namespace etl
/// Constructor.
//*************************************************************************
template <typename TIterator>
ETL_CONSTEXPR multi_span(TIterator begin_, TIterator end_)
ETL_CONSTEXPR14 multi_span(TIterator begin_, TIterator end_)
: span_list(etl::addressof(*begin_), etl::distance(begin_, end_))
{
}
Expand All @@ -237,23 +237,23 @@ namespace etl
/// Constructor.
//*************************************************************************
template <typename TIterator>
ETL_CONSTEXPR multi_span(TIterator begin_, size_t length_)
ETL_CONSTEXPR14 multi_span(TIterator begin_, size_t length_)
: span_list(etl::addressof(*begin_), length_)
{
}

//*************************************************************************
/// Copy Constructor.
//*************************************************************************
ETL_CONSTEXPR multi_span(const multi_span& other)
ETL_CONSTEXPR14 multi_span(const multi_span& other)
: span_list(other.span_list)
{
}

//*************************************************************************
/// Assignment operator
//*************************************************************************
ETL_CONSTEXPR multi_span& operator = (const multi_span & other)
ETL_CONSTEXPR14 multi_span& operator = (const multi_span & other)
{
span_list = other.span_list;

Expand All @@ -263,15 +263,15 @@ namespace etl
//*************************************************************************
///
//*************************************************************************
ETL_CONSTEXPR iterator begin() const
ETL_CONSTEXPR14 iterator begin() const
{
return iterator(span_list.begin(), span_list.end());
}

//*************************************************************************
///
//*************************************************************************
ETL_CONSTEXPR iterator end() const
ETL_CONSTEXPR14 iterator end() const
{
return iterator(span_list.end(), span_list.end());
}
Expand Down Expand Up @@ -328,7 +328,7 @@ namespace etl
//*************************************************************************
/// Returns the number of spans in the multi_span.
//*************************************************************************
ETL_CONSTEXPR size_t size_spans() const ETL_NOEXCEPT
ETL_CONSTEXPR14 size_t size_spans() const ETL_NOEXCEPT
{
return span_list.size();
}
Expand Down
6 changes: 6 additions & 0 deletions include/etl/profiles/determine_compiler_language_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,12 @@ SOFTWARE.
#endif
#elif defined(ETL_COMPILER_ARM5)
#define ETL_CPP20_SUPPORTED 0
#elif defined(ETL_COMPILER_GCC)
#if (__GNUC__ == 10)
#define ETL_CPP20_SUPPORTED (__cplusplus >= 201709L)
#else
#define ETL_CPP20_SUPPORTED (__cplusplus >= 202002L)
#endif
#else
#define ETL_CPP20_SUPPORTED (__cplusplus >= 202002L)
#endif
Expand Down

0 comments on commit 77ab40a

Please sign in to comment.