更新时间:2022-11-22 18:00:39
由于Visual C ++ 2010编译工具包(不完全符合C ++ 11)的限制,我不得不投降自己到劣等的方法。
Due to the limitations of Visual C++ 2010 Compilation Toolkit (not fully C++11 compliant), I had to surrender myself to inferior approaches.
这篇文章位于 http://***.com/a/15961043/ 383779 还建议我一个有趣的方法来获取值。
The post at http://***.com/a/15961043/383779 also suggested me an interesting approach for getting the values.
class Rotations
{
public:
typedef enum
{
ZERO= 0,
PLUS180= 180,
PLUS90 = 90,
MINUS90 = -90
}PossibleValues;
static const PossibleValues PossibleValuesCollection(int index) {
static const PossibleValues values[] = { ZERO, PLUS180, PLUS90, MINUS90 };
return values[index];
}
static int Count() { return 4; }
static PossibleValues Default(){ return ZERO; }
};