我有一个调用的枚举StackID,在我的代码中,我需要static_cast它int很多 - 例如
StackID
static_cast
int
StackID somestack; int id = static_cast<int>(somestack);
有没有一种替代方法可以一次又一次地进行这种演绎?我听说过"隐含的"转换 - 这是我可以在这里使用的东西吗?
(可能与这个问题有关)
c++
c++ ×1