diff --git a/panda/src/putil/updateSeq.I b/panda/src/putil/updateSeq.I index a3f4877c7f..99703059d4 100644 --- a/panda/src/putil/updateSeq.I +++ b/panda/src/putil/updateSeq.I @@ -11,48 +11,56 @@ * @date 1999-09-30 */ +/** + * Creates an UpdateSeq in the given state. + */ +CONSTEXPR UpdateSeq:: +UpdateSeq(unsigned int seq) : _seq(seq) { +} + /** * Creates an UpdateSeq in the 'initial' state. */ -INLINE UpdateSeq:: -UpdateSeq() { - _seq = (unsigned int)SC_initial; +CONSTEXPR UpdateSeq:: +UpdateSeq() : _seq((unsigned int)SC_initial) { } /** * Returns an UpdateSeq in the 'initial' state. */ -INLINE UpdateSeq UpdateSeq:: +CONSTEXPR UpdateSeq UpdateSeq:: initial() { - return UpdateSeq(); + return UpdateSeq((unsigned int)SC_initial); } /** * Returns an UpdateSeq in the 'old' state. */ -INLINE UpdateSeq UpdateSeq:: +CONSTEXPR UpdateSeq UpdateSeq:: old() { - UpdateSeq result; - result._seq = (unsigned int)SC_old; - return result; + return UpdateSeq((unsigned int)SC_old); } /** * Returns an UpdateSeq in the 'fresh' state. */ -INLINE UpdateSeq UpdateSeq:: +CONSTEXPR UpdateSeq UpdateSeq:: fresh() { - UpdateSeq result; - result._seq = (unsigned int)SC_fresh; - return result; + return UpdateSeq((unsigned int)SC_fresh); } /** * */ INLINE UpdateSeq:: -UpdateSeq(const UpdateSeq ©) { - _seq = AtomicAdjust::get(copy._seq); +UpdateSeq(const UpdateSeq ©) : _seq(AtomicAdjust::get(copy._seq)) { +} + +/** + * + */ +CONSTEXPR UpdateSeq:: +UpdateSeq(const UpdateSeq &&from) NOEXCEPT : _seq(from._seq) { } /** diff --git a/panda/src/putil/updateSeq.h b/panda/src/putil/updateSeq.h index 4899787244..5ba9de908f 100644 --- a/panda/src/putil/updateSeq.h +++ b/panda/src/putil/updateSeq.h @@ -35,13 +35,17 @@ * sequences are numeric and are monotonically increasing. */ class EXPCL_PANDA_PUTIL UpdateSeq { +private: + CONSTEXPR UpdateSeq(unsigned int seq); + PUBLISHED: - INLINE UpdateSeq(); - INLINE static UpdateSeq initial(); - INLINE static UpdateSeq old(); - INLINE static UpdateSeq fresh(); + CONSTEXPR UpdateSeq(); + CONSTEXPR static UpdateSeq initial(); + CONSTEXPR static UpdateSeq old(); + CONSTEXPR static UpdateSeq fresh(); INLINE UpdateSeq(const UpdateSeq ©); + CONSTEXPR UpdateSeq(const UpdateSeq &&from) NOEXCEPT; INLINE UpdateSeq &operator = (const UpdateSeq ©); INLINE void clear();