Open cmazakas opened 3 years ago
You could always do:
namespace my {
template<class T>
struct span
: boost::spans::span<T> {
using boost::spans::span<T>::span;
};
template<class T, std::size_t N>
struct static_span
: boost::spans::span<T, N> {
static_assert(N != boost::spans::dynamic_extent);
using boost::spans::span<T, N>::span;
};
} // my
A common complaint about
std::span
is that is usage of a NTTP for storage optimization is undesirable.Refactoring so that
span
is a constant 2 word-sized class would appease complaints from multiple users.static_span
would also self-document better.Both class templates should be interconvertible with one another.