From a2e839c5bae4158cbae71b738cb905bd8e5a6923 Mon Sep 17 00:00:00 2001 From: Glyn Leine Date: Wed, 20 Nov 2024 19:23:48 +0100 Subject: [PATCH] start work on compile time type names and type hashes so we can have a type->value storage --- applications/sandbox/.rythe_project | 4 +--- applications/sandbox/src/sandbox/source.cpp | 23 +++++++++++++++++++-- libraries/rythe/rythe-standard-library | 2 +- modules/rythe/core | 2 +- premake5.lua | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/applications/sandbox/.rythe_project b/applications/sandbox/.rythe_project index fdbf6994c..33f2465c4 100644 --- a/applications/sandbox/.rythe_project +++ b/applications/sandbox/.rythe_project @@ -1,8 +1,6 @@ local project = { dependencies = { - "rythe/core", - "rythe/graphics", - "rythe/audio" + "rythe/core" } } diff --git a/applications/sandbox/src/sandbox/source.cpp b/applications/sandbox/src/sandbox/source.cpp index 1f84dc4e4..9dbeb7825 100644 --- a/applications/sandbox/src/sandbox/source.cpp +++ b/applications/sandbox/src/sandbox/source.cpp @@ -6,12 +6,31 @@ #endif #include +#include +template +struct foo +{ +}; int RYTHE_CCONV reportModules(rythe::core::Program& program) { using namespace rythe; - program.addEngineInstance + program.addEngineInstance(); + + [[maybe_unused]] constexpr rsl::constexpr_string A = "Something"; + [[maybe_unused]] constexpr rsl::constexpr_string B = "Other"; + [[maybe_unused]] constexpr rsl::constexpr_string result = A + B; + + [[maybe_unused]] constexpr rsl::constexpr_string hello_world = "hello world"; + [[maybe_unused]] constexpr rsl::constexpr_string shorten = hello_world.filter_if([](char y) { return ' ' != y; }); + [[maybe_unused]] constexpr rsl::constexpr_string optimal = shorten.refit(); + + constexpr rsl::constexpr_string typeName = rsl::type_name(); + [[maybe_unused]] constexpr auto shrunk = typeName.refit(); + constexpr rsl::id_type typeHash = rsl::type_id(); + + rsl::log::debug("type info: {} : {}, {}, {}, {}", rsl::string_view(typeName), typeHash, typeName.size(), typeName.capacity(), shrunk.capacity()); - return 0; + return -1; } diff --git a/libraries/rythe/rythe-standard-library b/libraries/rythe/rythe-standard-library index a9f46f5df..07255a8ed 160000 --- a/libraries/rythe/rythe-standard-library +++ b/libraries/rythe/rythe-standard-library @@ -1 +1 @@ -Subproject commit a9f46f5df960cd9976eca1f22fa3e6f3700e7003 +Subproject commit 07255a8edfb7821cea2fe0ef89a98728aa7f124e diff --git a/modules/rythe/core b/modules/rythe/core index 60901ea86..efc8c50a8 160000 --- a/modules/rythe/core +++ b/modules/rythe/core @@ -1 +1 @@ -Subproject commit 60901ea86fd15569153898efb88ff7015a263947 +Subproject commit efc8c50a8a33f8e35c7b2189c9273276ab15197a diff --git a/premake5.lua b/premake5.lua index 729098452..d87e041c4 100644 --- a/premake5.lua +++ b/premake5.lua @@ -1,7 +1,7 @@ -- root workspace, all sub-project should be included workspace "rythe" location("build/" .. _ACTION) - configurations { "Debug", "Development", "Release" } + configurations { "Debug", "Development", "Release", "Debug-asan", "Release-profiling" } os.chdir(_MAIN_SCRIPT_DIR)