mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-09-02 02:37:55 +00:00
Change static const
to static constexpr
wherever possible
Since we require C++11, most of these consts can be constexpr. Two `static const ld` remain non-compile-time-evaluable because they depend on the runtime `log` function. One `static const cld` remains non-compile-time because `std::complex<T>` doesn't become constexpr until C++14.
This commit is contained in:
4
rug.cpp
4
rug.cpp
@@ -476,7 +476,7 @@ EX void buildTorusRug() {
|
||||
|
||||
r->valid = true;
|
||||
|
||||
static const int X = 100003; // a prime
|
||||
static constexpr int X = 100003; // a prime
|
||||
auto gluefun = [] (ld z) { return int(frac(z + .5/X) * X); };
|
||||
auto p = make_pair(gluefun(h[0]), gluefun(h[1]));
|
||||
auto& r2 = glues[p];
|
||||
@@ -1374,7 +1374,7 @@ EX void actDraw() {
|
||||
|
||||
int besti;
|
||||
|
||||
static const ld RADAR_INF = 1e12;
|
||||
static constexpr ld RADAR_INF = 1e12;
|
||||
ld radar_distance = RADAR_INF;
|
||||
|
||||
EX shiftpoint gethyper(ld x, ld y) {
|
||||
|
Reference in New Issue
Block a user