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:
@@ -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/";
|
||||
|
||||
Reference in New Issue
Block a user