1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-20 12:20:01 +00:00

racing:: with CAP_RACING off, no warning on unused variable racing::on

This commit is contained in:
Zeno Rogue 2018-12-06 15:35:01 +01:00
parent 8225593756
commit 490ee83f3a

13
hyper.h
View File

@ -4697,7 +4697,18 @@ bool subscreen_split(reaction_t for_each_subscreen);
#else
namespace racing { static bool on = false; }
// static bool on = false: emits a warning
// static const bool on = false: no warning, but does not allow assignment
struct always_false {
operator bool() const { return false; };
void operator = (bool b) const {};
};
namespace racing {
static const always_false on;
}
inline bool subscreen_split(reaction_t for_each_subscreen) { return false; }
#endif