mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-11-29 14:26:19 +08:00
17 lines
781 B
Markdown
17 lines
781 B
Markdown
# `rfl::Tuple`
|
|
|
|
The problem with `std::tuple` is that it is recursively implemented. That is fine when you
|
|
have a small number of elements in your tuple, but as you increase the size of the tuple,
|
|
you will pay a price in terms of compile time.
|
|
|
|
That is why reflect-cpp contains `rfl::Tuple`, which in many ways behaves
|
|
just like `std::tuple`, but it compiles considerably faster.
|
|
|
|
The only downside of `rfl::Tuple` is that it cannot be used inside `constexpr` or `consteval`
|
|
functions.
|
|
|
|
You can use the functions `rfl::get`, `rfl::make_tuple`, `rfl::tuple_element_t`,
|
|
`rfl::tuple_size_v`, `rfl::tuple_cat` or `rfl::apply` to create or access the
|
|
tuple and they work the same way as their equivalents in the standard library.
|
|
In fact, `std::get` will also work on `rfl::Tuple`.
|