Skip to content

Commit

Permalink
[skip ci] Fix: if available, use C++17 std::data(), std::size() for m…
Browse files Browse the repository at this point in the history
…ake_ring_span() example (#11)
  • Loading branch information
martinmoene committed Feb 15, 2019
1 parent 216955b commit 6a8e32a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions example/03-make-ring-span.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ inline auto vtype( C & ) -> typename C::value_type
return {};
}

template< typename T, size_t N >
inline auto vtype( T(&)[N] ) -> T
{
return {};
}

#if nsrs_CPP17_OR_GREATER

using std::data;
using std::size;

#else // nsrs_CPP17_OR_GREATER

template< typename T, size_t N >
inline auto vtype( T(&)[N] ) -> T
{
return {};
}

template< typename T, size_t N >
inline auto data( T(&arr)[N] ) -> T*
{
Expand Down

0 comments on commit 6a8e32a

Please sign in to comment.