vecs
Fast, flexible ecs in C++ with ergonomic API
Loading...
Searching...
No Matches
bundle.h
1#ifndef __VECS_BUNDLE_H__
2#define __VECS_BUNDLE_H__
3
4#include <tuple>
5
6namespace vecs {
7
8struct TagBundle {};
9
10namespace _traits {
11
12 template<typename T>
13 struct is_bundle: std::is_base_of<TagBundle, std::decay_t<T>> {};
14
15 template<typename T>
16 constexpr bool is_bundle_v = is_bundle<T>::value;
17
18} // namespace _traits
19
30template<typename... Components>
31struct Bundle: TagBundle {
32 std::tuple<Components...>
34
50 constexpr Bundle(Components&&... components) :
51 components(std::forward<Components>(components)...) {}
52};
53
54} // namespace vecs
55
56#endif
Definition bundle.h:13
A collection of components grouped together as a single bundle.
Definition vecs.h:171
std::tuple< Components... > components
A tuple holding the components in the bundle.
Definition bundle.h:33
constexpr Bundle(Components &&... components)
Constructs a Bundle with the given components.
Definition bundle.h:50
Definition bundle.h:8