File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,8 @@ struct Span
3131 // clang-format off
3232 using SizeType = size_t ;
3333 using VoidType = typename TypeTraits::SameConstnessAs<Type, void >::type;
34- template <typename U> using TypeIfNotVoid = typename TypeTraits::EnableIf<not TypeTraits::IsSame<U, VoidType>::value, Type>::type;
34+ template <typename U> using TypeIfNotVoid = typename TypeTraits::EnableIf<not TypeTraits::IsSame<U, VoidType>::value, Type>::type;
35+ template <typename U> using TypeInitializerList = typename TypeTraits::EnableIf<TypeTraits::IsConst<U>::value and not TypeTraits::IsSame<U, VoidType>::value, Type>::type;
3536 template <typename U> using SameType = TypeTraits::IsSame<typename TypeTraits::RemoveConst<U>::type, typename TypeTraits::RemoveConst<Type>::type>;
3637 template <typename U> using EnableNotVoid = typename TypeTraits::EnableIf<SameType<U>::value and not TypeTraits::IsSame<U, VoidType>::value, bool >::type;
3738 // clang-format on
@@ -60,7 +61,7 @@ struct Span
6061 // / @brief Span specialized constructor (mainly used for converting const char* to StringView)
6162 // / @param list an initializer list of elements
6263 template <typename U = Type>
63- constexpr Span (std::initializer_list<TypeIfNotVoid <U>> list) : items(nullptr ), sizeElements(0 )
64+ constexpr Span (std::initializer_list<TypeInitializerList <U>> list) : items(nullptr ), sizeElements(0 )
6465 {
6566 // We need this two step initialization to avoid warnings on all compilers
6667 items = list.begin ();
You can’t perform that action at this time.
0 commit comments