16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

Use the sq function to force constexpr expressions for numeric literals and enhance readability

This commit is contained in:
docentYT
2026-04-28 13:23:14 +02:00
parent 6be1b0886d
commit ca839652bf
15 changed files with 64 additions and 59 deletions

View File

@@ -29,6 +29,11 @@ template <typename T> T sign(T x)
#define DegToRad(a) ((M_PI / 180.0) * (a)) //(a) w nawiasie, bo może być dodawaniem
#define RadToDeg(r) ((180.0 / M_PI) * (r))
template <typename T> constexpr T sq(T v)
{
return v * v;
}
namespace paths
{
inline constexpr const char *scenery = "scenery/";