这段代码:
constexpr uint32_t ticksPerSecond = 100000;
struct ticks {
uint32_t count;
template<typename integer>
constexpr explicit ticks(integer c) : count(c) { }
explicit inline operator float() {
return count / (float) ticksPerSecond;
}
};
template<>
constexpr explicit ticks::ticks<float>(float s) : count(s * ticksPerSecond) { }
给我错误:
timer.hpp:(last line of snippet):
error: only declarations of constructors can be 'explicit'
肯定ticks::ticks
是构造函数?