Browse Source

stl: cleanup/avoid pointless uses

skypjack 1 month ago
parent
commit
c58080488b

+ 0 - 2
CMakeLists.txt

@@ -205,12 +205,10 @@ if(ENTT_INCLUDE_HEADERS)
         stl/cstddef.hpp
         stl/cstdint.hpp
         stl/functional.hpp
-        stl/ios.hpp
         stl/iterator.hpp
         stl/limits.hpp
         stl/memory.hpp
         stl/ostream.hpp
-        stl/sstream.hpp
         stl/string.hpp
         stl/string_view.hpp
         stl/tuple.hpp

+ 0 - 2
src/entt/entt.hpp

@@ -78,12 +78,10 @@ namespace entt::stl {}
 #include "stl/cstddef.hpp"
 #include "stl/cstdint.hpp"
 #include "stl/functional.hpp"
-#include "stl/ios.hpp"
 #include "stl/iterator.hpp"
 #include "stl/limits.hpp"
 #include "stl/memory.hpp"
 #include "stl/ostream.hpp"
-#include "stl/sstream.hpp"
 #include "stl/string.hpp"
 #include "stl/string_view.hpp"
 #include "stl/tuple.hpp"

+ 0 - 18
src/entt/stl/ios.hpp

@@ -1,18 +0,0 @@
-#ifndef ENTT_STL_IOS_HPP
-#define ENTT_STL_IOS_HPP
-
-/*! @cond ENTT_INTERNAL */
-#if __has_include(<entt/ext/stl/ios.hpp>)
-#    include <entt/ext/stl/ios.hpp>
-#else
-#    include <ios>
-
-namespace entt::stl {
-
-using std::boolalpha;
-
-} // namespace entt::stl
-#endif
-/*! @endcond */
-
-#endif

+ 0 - 18
src/entt/stl/sstream.hpp

@@ -1,18 +0,0 @@
-#ifndef ENTT_STL_SSTREAM_HPP
-#define ENTT_STL_SSTREAM_HPP
-
-/*! @cond ENTT_INTERNAL */
-#if __has_include(<entt/ext/stl/sstream.hpp>)
-#    include <entt/ext/stl/sstream.hpp>
-#else
-#    include <sstream>
-
-namespace entt::stl {
-
-using std::stringstream;
-
-} // namespace entt::stl
-#endif
-/*! @endcond */
-
-#endif

+ 2 - 5
src/entt/tools/davey.hpp

@@ -13,8 +13,6 @@
 #include "../meta/pointer.hpp"
 #include "../meta/resolve.hpp"
 #include "../stl/cstdint.hpp"
-#include "../stl/ios.hpp"
-#include "../stl/sstream.hpp"
 #include "../stl/string.hpp"
 
 #if __has_include(<imgui.h>)
@@ -60,9 +58,8 @@ static void present_element(const meta_any &obj, OnEntity on_entity) {
             }
         } else if(type.is_arithmetic()) {
             if(type.info() == type_id<bool>()) {
-                stl::stringstream buffer{};
-                buffer << stl::boolalpha << elem.template cast<bool>();
-                ImGui::Text("%s: %s", label, buffer.str().data());
+                const auto value = elem.template cast<bool>();
+                ImGui::Text("%s: %s", label, value ? "true" : "false");
             } else if(type.info() == type_id<char>()) {
                 ImGui::Text("%s: %c", label, elem.template cast<char>());
             } else if(type.is_integral()) {

+ 0 - 2
test/CMakeLists.txt

@@ -402,12 +402,10 @@ SETUP_BASIC_TEST(
         entt/stl_ext/cstddef.cpp
         entt/stl_ext/cstdint.cpp
         entt/stl_ext/functional.cpp
-        entt/stl_ext/ios.cpp
         entt/stl_ext/iterator.cpp
         entt/stl_ext/limits.cpp
         entt/stl_ext/memory.cpp
         entt/stl_ext/ostream.cpp
-        entt/stl_ext/sstream.cpp
         entt/stl_ext/string.cpp
         entt/stl_ext/string_view.cpp
         entt/stl_ext/tuple.cpp

+ 0 - 6
test/entt/stl_ext/ios.cpp

@@ -1,6 +0,0 @@
-#include <gtest/gtest.h>
-#include <entt/stl/ios.hpp>
-
-TEST(IOS, HasInclude) {
-    static_assert(entt::stl::entt_ext_ios, "Header not properly included");
-}

+ 0 - 6
test/entt/stl_ext/sstream.cpp

@@ -1,6 +0,0 @@
-#include <gtest/gtest.h>
-#include <entt/stl/sstream.hpp>
-
-TEST(SStream, HasInclude) {
-    static_assert(entt::stl::entt_ext_sstream, "Header not properly included");
-}