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);
有什麼想法爲什麼?