Skip to content

Commit

Permalink
start work on compile time type names and type hashes so we can have …
Browse files Browse the repository at this point in the history
…a type->value storage
  • Loading branch information
GlynLeine committed Nov 20, 2024
1 parent 590f331 commit a2e839c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 8 deletions.
4 changes: 1 addition & 3 deletions applications/sandbox/.rythe_project
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
local project = {
dependencies = {
"rythe/core",
"rythe/graphics",
"rythe/audio"
"rythe/core"
}
}

Expand Down
23 changes: 21 additions & 2 deletions applications/sandbox/src/sandbox/source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,31 @@
#endif

#include <core/core.hpp>
#include <rsl/type_traits>

template<typename T>
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<shorten.size() + 1>();

constexpr rsl::constexpr_string typeName = rsl::type_name<std::string>();
[[maybe_unused]] constexpr auto shrunk = typeName.refit<typeName.size() + 1>();
constexpr rsl::id_type typeHash = rsl::type_id<std::string>();

rsl::log::debug("type info: {} : {}, {}, {}, {}", rsl::string_view(typeName), typeHash, typeName.size(), typeName.capacity(), shrunk.capacity());

return 0;
return -1;
}
2 changes: 1 addition & 1 deletion modules/rythe/core
2 changes: 1 addition & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
@@ -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)

Expand Down

0 comments on commit a2e839c

Please sign in to comment.