mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +00:00
Gets explicit about constexpr expectations here.
This commit is contained in:
parent
e23d1a2958
commit
09513ec14c
@ -29,7 +29,7 @@ template <class T, int multiplier = 1, int divider = 1, class LocalTimeScale = H
|
|||||||
|
|
||||||
/// Adds time to the actor.
|
/// Adds time to the actor.
|
||||||
forceinline void operator += (const LocalTimeScale &rhs) {
|
forceinline void operator += (const LocalTimeScale &rhs) {
|
||||||
if(multiplier != 1) {
|
if constexpr (multiplier != 1) {
|
||||||
time_since_update_ += rhs * multiplier;
|
time_since_update_ += rhs * multiplier;
|
||||||
} else {
|
} else {
|
||||||
time_since_update_ += rhs;
|
time_since_update_ += rhs;
|
||||||
@ -52,7 +52,7 @@ template <class T, int multiplier = 1, int divider = 1, class LocalTimeScale = H
|
|||||||
forceinline void flush() {
|
forceinline void flush() {
|
||||||
if(!is_flushed_) {
|
if(!is_flushed_) {
|
||||||
is_flushed_ = true;
|
is_flushed_ = true;
|
||||||
if(divider == 1) {
|
if constexpr (divider == 1) {
|
||||||
object_.run_for(time_since_update_.template flush<TargetTimeScale>());
|
object_.run_for(time_since_update_.template flush<TargetTimeScale>());
|
||||||
} else {
|
} else {
|
||||||
const auto duration = time_since_update_.template divide<TargetTimeScale>(LocalTimeScale(divider));
|
const auto duration = time_since_update_.template divide<TargetTimeScale>(LocalTimeScale(divider));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user