2024-05-31 22:59:00 -04:00
|
|
|
#ifndef RFL_MAKENAMEDTUPLE_HPP_
|
|
|
|
#define RFL_MAKENAMEDTUPLE_HPP_
|
|
|
|
|
|
|
|
#include <type_traits>
|
|
|
|
|
|
|
|
#include "NamedTuple.hpp"
|
|
|
|
|
|
|
|
namespace rfl {
|
|
|
|
|
2024-06-08 14:10:59 -04:00
|
|
|
/// Convenience constructor that doesn't require you
|
|
|
|
/// to explitly define the field types.
|
|
|
|
template <class... FieldTypes>
|
|
|
|
inline auto make_named_tuple(FieldTypes&&... _args) {
|
2024-06-16 00:13:15 -04:00
|
|
|
return NamedTuple<std::remove_cvref_t<FieldTypes>...>(std::forward<FieldTypes>(_args)...);
|
2024-06-08 14:10:59 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
/// Convenience constructor that doesn't require you
|
|
|
|
/// to explitly define the field types.
|
|
|
|
template <class... FieldTypes>
|
|
|
|
inline auto make_named_tuple(const FieldTypes&... _args) {
|
|
|
|
return NamedTuple<FieldTypes...>(_args...);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Explicit overload for creating empty named tuples.
|
|
|
|
inline auto make_named_tuple() { return NamedTuple<>(); }
|
|
|
|
|
|
|
|
} // namespace rfl
|
|
|
|
|
|
|
|
#endif // RFL_MAKENAMEDTUPLE_HPP_
|