I wrote some
template<typename ...T>
inline ARRAY<typename std::common_type<T...>::type, sizeof...(T)> make_array_(const T&..._r)
{ return ARRAY<typename std::common_type<T...>::type, sizeof...(T)>(_r...);
}
which creates a symbol
0000000000000361 t namespace::ARRAY_IMPL<std::common_type<double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double>::type, sizeof (double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double), std::is_trivial<std::common_type<double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double>::type>::value> namespace::make_array_<double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double>(double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&, double const&)
Why is std::common_type<double, double, double>::type not collapsing? g++ version is 5.3.0.
#include <type_traits>
template<typename T, std::size_t SIZE>
struct ARRAY
{ template<typename ...T1>
ARRAY(T1&&...)
{
}
};
template<typename ...T>
inline ARRAY<typename std::common_type<T...>::type, sizeof...(T)> make_array_(const T&..._r)
{ return ARRAY<typename std::common_type<T...>::type, sizeof...(T)>(_r...);
}
const auto sA = make_array_(1.0, 2.0, 3.0);
int main(int, char**)
{
}
Aucun commentaire:
Enregistrer un commentaire