diff options
author | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2015-08-07 09:59:12 +0100 |
---|---|---|
committer | Andreas Sandberg <Andreas.Sandberg@ARM.com> | 2015-08-07 09:59:12 +0100 |
commit | 3e26756f1dfe1ddd1d7f5e458771c9bf79acb09a (patch) | |
tree | 6d189d36689d70e7ce905492af89c8d7d43673e2 /src/cpu/checker | |
parent | 83a668ad2564d1231f59f130c81cab6e7e31c364 (diff) | |
download | gem5-3e26756f1dfe1ddd1d7f5e458771c9bf79acb09a.tar.xz |
base: Use constexpr in Cycles
Declare the constructor and all of the operators that don't change the
state of a Cycles instance as constexpr. This makes it possible to use
Cycles as a static constant and allows the compiler to evaulate simple
expressions at compile time. An unfortunate side-effect of this is
that we cannot use assertions since C++11 doesn't support them in
constexpr functions. As a workaround, we throw an invalid_argument
exception when the assert would have triggered. A nice side-effect of
this is that the compiler will evaluate the "assertion" at compile
time when an expression involving Cycles can be statically evaluated.
Diffstat (limited to 'src/cpu/checker')
0 files changed, 0 insertions, 0 deletions