Skip to content

Commit

Permalink
Merge branch 'compile_time_systems' of https://github.com/kgorking/ecs
Browse files Browse the repository at this point in the history
…into compile_time_systems
  • Loading branch information
kgorking committed Sep 10, 2024
2 parents 6c07d90 + 0377346 commit 90c376d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/ecs/ecs.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -2544,6 +2544,11 @@ using reduce_parent_t =
template <typename T>
using naked_component_t = std::remove_pointer_t<std::remove_cvref_t<reduce_parent_t<T>>>;

// Ensure that the passed type is naked, ie, it's
// an 'int' and not an 'int*' or 'int const&'.
template <typename T>
concept naked_component = std::same_as<T, naked_component_t<T>>;

// Alias for stored pools
template <typename T>
using pool = component_pool<naked_component_t<T>>* const;
Expand Down
5 changes: 5 additions & 0 deletions include/ecs/ecs_sh.h
Original file line number Diff line number Diff line change
Expand Up @@ -2545,6 +2545,11 @@ using reduce_parent_t =
template <typename T>
using naked_component_t = std::remove_pointer_t<std::remove_cvref_t<reduce_parent_t<T>>>;

// Ensure that the passed type is naked, ie, it's
// an 'int' and not an 'int*' or 'int const&'.
template <typename T>
concept naked_component = std::same_as<T, naked_component_t<T>>;

// Alias for stored pools
template <typename T>
using pool = component_pool<naked_component_t<T>>* const;
Expand Down

0 comments on commit 90c376d

Please sign in to comment.