-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviews.gem5.org/r/2889/
-----------------------------------------------------------

Review request for Default.


Repository: gem5


Description
-------

Changeset 10874:f927a77a299c
---------------------------
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.


Diffs
-----

  src/base/types.hh ebb3d0737aa7 

Diff: http://reviews.gem5.org/r/2889/diff/


Testing
-------


Thanks,

Andreas Sandberg

_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to