Searched hist:11004 (Results 1 - 1 of 1) sorted by relevance
/gem5/src/base/ | ||
H A D | types.hh | diff 11004:2c347b12cc9c Fri Aug 07 04:59:00 EDT 2015 Andreas Sandberg <Andreas.Sandberg@ARM.com> 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. |
Completed in 11 milliseconds