I want to use std::span
as a template template argument to a function.
gcc seems to accept the following code, but clang rejects.
#include <iostream>
#include <span>
#include <vector>
std::vector v{1,2,3,4,5,6};
template <template <typename> class S>
S<int> GetSpan()
{
return v;
}
int main()
{
auto x = GetSpan<std::span>();
return 0;
}
Can someone please explain why this is the case ?
template <template <typename...> class S>
to be more generic. I need to instantiate the same function with a in-house span type which doesn't have extent argument. – Marchpast