0
我想一个为size_t分配到这个容器:如何将类型size_t的指针转换为枚举指针?
std::vector <nts::Tristate *> _components;
要做到这一点,我想投const size_t &
到nts::Tristate *
this->_components[0] = static_cast<nts::Tristate *>(&value);
但我有以下错误:
error: invalid static_cast from type ‘const size_t* {aka const long unsigned int*}’ to type ‘nts::Tristate*’
this->_components[0] = static_cast<nts::Tristate *>(&value);
有什么想法为什么?