Nicol . , , , . . GCC 4.9.
template<class T, class...>
struct are_convertible : std::true_type
{};
template<class T, class U, class... TT>
struct are_convertible<T, U, TT...>
: std::integral_constant<bool, std::is_convertible<T,U>{} && are_convertible<T, TT...>{}>
{};
template <typename T, int DIM>
class Geometry
{
public:
template<typename... Args>
void addPoint(Args... coords)
{
static_assert(sizeof...(coords) == DIM, "Number of components does not match template");
static_assert(are_convertible<T, Args...>{}, "All arguments' types must be convertible to the template type");
}
};