In contrast to GCC 5, Clang 6 complains about the following error:
candidate template ignored: substitution failure [with U = char, Us = ]: typedef 'type' cannot be referenced with a class specifier Tuple(U&& u, Us&&... rest) : m_element(::std::forward(u)), m_rest(::std::forward(rest...)...)
I use my own Tuple implementation with
//! Declaration of tuple typename with multiple elements
template<typename T, typename... Ts>
class Tuple<T, Ts...>
{
public:
T m_element;
Tuple<Ts...> m_rest;
template<typename U,
typename... Us,
typename = class ::std::enable_if<!::std::is_base_of<Tuple,typename ::std::decay<U>::type>::value>::type>
Tuple(U&& u, Us&&... rest) : m_element(::std::forward<U>(u)), m_rest(::std::forward<Us>(rest)...)
{
}
};
template<typename... Ts>
Tuple<typename ::std::decay<Ts>::type...> make_tuple(Ts&&... elements)
{
return Tuple<typename ::std::decay<Ts>::type...>(::std::forward<Ts>(elements)...);
}
What is clang doing differently than GCC? And how can I fix this?
Thanks!