From 39179ba1adde7f860826bc5e667f0f224758e5b3 Mon Sep 17 00:00:00 2001 From: jan p springer Date: Thu, 26 Dec 2013 15:15:53 +0000 Subject: [PATCH] un/formatted() usage to un/formatted --- glm/gtx/io.hpp | 11 ++++------- glm/gtx/io.inl | 18 +++++++++--------- test/gtx/gtx_io.cpp | 4 ++-- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/glm/gtx/io.hpp b/glm/gtx/io.hpp index f1b8dd53..9e68cd39 100644 --- a/glm/gtx/io.hpp +++ b/glm/gtx/io.hpp @@ -138,9 +138,6 @@ namespace glm typedef basic_format_saver format_saver; typedef basic_format_saver wformat_saver; - struct formatted { /* empty */ }; - struct unformatted { /* empty */ }; - struct precision { unsigned value; @@ -178,11 +175,11 @@ namespace glm template FTy const& get_facet(std::basic_ios&); + template + std::basic_ios& formatted(std::basic_ios&); + template + std::basic_ios& unformattet(std::basic_ios&); - template - std::basic_ostream& operator<<(std::basic_ostream&, formatted const&); - template - std::basic_ostream& operator<<(std::basic_ostream&, unformatted const&); template std::basic_ostream& operator<<(std::basic_ostream&, precision const&); template diff --git a/glm/gtx/io.inl b/glm/gtx/io.inl index 7d3e88fc..84fc29d9 100644 --- a/glm/gtx/io.inl +++ b/glm/gtx/io.inl @@ -119,21 +119,21 @@ namespace glm } template - GLM_FUNC_QUALIFIER std::basic_ostream& - operator<<(std::basic_ostream& os, formatted const&) + GLM_FUNC_QUALIFIER std::basic_ios& + formatted(std::basic_ios& ios) { - const_cast&>(get_facet>(os)).formatted = true; + const_cast&>(get_facet>(ios)).formatted = true; - return os; + return ios; } - + template - GLM_FUNC_QUALIFIER std::basic_ostream& - operator<<(std::basic_ostream& os, unformatted const&) + GLM_FUNC_QUALIFIER std::basic_ios& + unformatted(std::basic_ios& ios) { - const_cast&>(get_facet>(os)).formatted = false; + const_cast&>(get_facet>(ios)).formatted = false; - return os; + return ios; } template diff --git a/test/gtx/gtx_io.cpp b/test/gtx/gtx_io.cpp index e9ab76e7..8c479b5f 100644 --- a/test/gtx/gtx_io.cpp +++ b/test/gtx/gtx_io.cpp @@ -80,7 +80,7 @@ int test_io_quat(OS& os) { glm::io::basic_format_saver const iofs(os); - os << glm::io::unformatted() + os << glm::io::unformatted << type_name(os, q) << ": " << q << '\n'; } @@ -157,7 +157,7 @@ int test_io_mat(OS& os) << "mat4x3<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat4x3(v3_1, v3_2, v3_3, v3_4) << '\n' << "mat4x4<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat4x4(v4_1, v4_2, v4_3, v4_4) << '\n'; - os << glm::io::unformatted() + os << glm::io::unformatted << glm::io::order(glm::io::order_type::column_major) << "mat2x2<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat2x2(v2_1, v2_2) << '\n' << "mat2x3<" << typeid(T).name() << ',' << P << ">: " << glm::detail::tmat2x3(v3_1, v3_2) << '\n'