mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Adds std::format support for math types
Adds `std::formatter` specializations for `Mat`, `Vector2`, `Vector3`, and `Vector4` types, enabling the use of `std::format` for these types. This simplifies formatting and printing of these mathematical objects, improving code readability and consistency. Also adds a hash function specialization for Vector3.
This commit is contained in:
@@ -125,7 +125,7 @@ TEST_F(UnitTestMat, Clear)
|
||||
|
||||
TEST_F(UnitTestMat, ToString)
|
||||
{
|
||||
const std::string str = m2.to_string();
|
||||
const std::string str = std::format("{}", m2);
|
||||
EXPECT_FALSE(str.empty());
|
||||
EXPECT_EQ(str, "[[ 1.000, 2.000]\n [ 3.000, 4.000]]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user