// Math is independent from the rest of the library, to ensure seamless usage with other client. #pragma once #ifdef P_BUILD_LIB #include "PhanesEnginePCH.h" #else #include #include #endif #ifdef P_WIN_BUILD #ifdef P_DEBUG #define P_DEBUGBREAK DebugBreak(); #else #define P_DEBUGBREAK #endif // P_DEBUG #define FORCEINLINE __forceinline #elif defined(P_LINUX_BUILD) #ifdef P_DEBUG #define P_DEBUGBREAK __builtin_trap(); #else #define P_DEBUGBREAK #endif // P_DEBUG #define FORCEINLINE inline __attribute__((always_inline)) #elif defined(P_ARM_BUILD) #error Only Windows is supported at the moment. #else #error The target system must be defined. (See https://github.com/scorpioblood/PhanesEngine for more information) #endif // P_WIN_BUILD namespace Phanes::Core::Math { // Typenames with RealType constrain have to be floating point numbers. template concept RealType = std::is_floating_point_v; // Typenames with IntType constrain have to be integer number. template concept IntType = std::is_integral_v; // Typenames with Arithmethic constrain have to be number. template concept Arithmethic = std::is_arithmetic_v; // Alias for shared_ptr template using Ref = std::shared_ptr; // Alias for make_shared template constexpr Ref MakeRef(Args&& ...args) { return std::make_shared(std::forward(args)...); } // Alias for unique ptr template using Scope = std::unique_ptr; // Alias for make_unique template constexpr Scope MakeScope(Args&& ...args) { return std::make_unique(std::forward(args)...); } }