Eigen::VectorXd
是一个用于
Eigen::Matrix<double, Dynamic, 1>
. 向前走,
Eigen::MatrixBase<T>
Eigen::Matrix<T>
. 在重载解析中,引用的实例的绑定
特征向量
至
const Eigen::VectorXd&
参数具有通过派生到基转换获胜的精确匹配排名(由
void foo(const Eigen::MatrixBase<T>&
#include <type_traits>
#include <utility>
namespace detail
{
template <typename T>
std::true_type test(const volatile Eigen::MatrixBase<T>&);
std::false_type test(...);
}
template <typename T>
using is_eigen_matrix = decltype(detail::test(std::declval<T&>()));
template <class T>
void foo(const Eigen::MatrixBase<T>& data)
{
}
template <class T>
auto foo(const T& data)
-> typename std::enable_if<not is_eigen_matrix<T>::value>::type
{
}
DEMO