QVM: Quaternions, Vectors, Matrices
is_scalar
#include <boost/qvm/scalar_traits.hpp>[ORIG_END] -->
namespace
boost
{
namespace
qvm
{
template <class T>
struct is_scalar
{
bool const value=false;
};
template <> struct is_scalar<char> { static bool const value=true; };
template <> struct is_scalar<signed char> { static bool const value=true; };
template <> struct is_scalar<unsigned char> { static bool const value=true; };
template <> struct is_scalar<signed short> { static bool const value=true; };
template <> struct is_scalar<unsigned short> { static bool const value=true; };
template <> struct is_scalar<signed int> { static bool const value=true; };
template <> struct is_scalar<unsigned int> { static bool const value=true; };
template <> struct is_scalar<signed long> { static bool const value=true; };
template <> struct is_scalar<unsigned long> { static bool const value=true; };
template <> struct is_scalar<float> { static bool const value=true; };
template <> struct is_scalar<double> { static bool const value=true; };
}
}
Этот шаблон типа определяет значение постоянной булевой константы времени компиляции, которое может быть использовано для определения того, является ли типTдействительным скалярным типом. Он должен быть специализирован вместе с шаблономscalar_traits, чтобы ввести пользовательский скалярный тип для повышения QVM. Такие типы должны удовлетворятьскалярным требованиям.