我有一个带有两个非类型模板参数的 C++ 类:
size_t 类型的维度和对对象向量的 const 引用。
template <size_t DIMENSION, const std::vector<Tuple>& BORDERS>
class Rule {
public:
Rule(const std::vector<Tuple>& ranges, const Action& action) :
ranges_(ranges),
action_(action) {};
private:
std::vector<Tuple> ranges_;
Action action_;
};
是否有可能在编译时确保以下条件成立?
DIMENSION == BORDERS.size()
提前感谢您的任何建议。