1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-10-26 19:37:40 +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:
Arthur O'Dwyer
2023-08-23 09:44:37 -08:00
parent b70b339f52
commit 62629f3e70
48 changed files with 453 additions and 458 deletions

View File

@@ -139,7 +139,7 @@ void compute_skyvertices(const vector<sky_item>& sky) {
transmatrix T1 = unshift(si.T);
hyperpoint ci = kleinize(get_corner_position(c, i, 3));
hyperpoint cj = kleinize(get_corner_position(c, j, 3));
static const int prec = 8;
static constexpr int prec = 8;
ci = (ci - C0)/prec;
cj = (cj - C0)/prec;
glhr::colored_vertex vs[prec+1][prec+1], vh[prec+1][prec+1];
@@ -194,7 +194,7 @@ void compute_skyvertices(const vector<sky_item>& sky) {
for(int i=0; i<c->type; i++) {
static const int prec = 2;
static constexpr int prec = 2;
if(1) {
cellwalker cw0(c, i);