1#ifndef _BBM_CONSTRUCTOR_H_
2#define _BBM_CONSTRUCTOR_H_
50 template<
typename T,
string_literal N>
51 struct attribute_to_arg_impl
56 template<
typename T,
string_literal N>
requires concepts::bsdf_attribute<T>
57 struct attribute_to_arg_impl<T,N>
63 template<
typename T,
string_literal N>
64 using attribute_to_arg =
typename attribute_to_arg_impl<T,N>::type;
69 template<
typename... Ts, string_literal... Ns>
89 template<
typename TUP>
requires is_named_v<TUP>
122#define BBM_DEFAULT_CONSTRUCTOR(ClassName) \
123 using constructor_args_t = bbm::attribute_tuple_to_args_t< BBM_ATTRIBUTES_T >; \
125 inline ClassName(const constructor_args_t& args) \
127 auto const_cast_tuple = []<typename TUP, size_t... IDX>(TUP&& tup, std::index_sequence<IDX...>) \
129 return std::forward_as_tuple( const_cast<std::decay_t<decltype(std::get<IDX>(tup))>&>( std::get<IDX>(tup) )... ); \
132 const_cast_tuple(bbm::reflection::attributes(*this), std::make_index_sequence<bbm::reflection::attributes_size<decltype(*this)>>{}) = args.values(); \
133 constructor_post_init(); \
136 BBM_CONSTRUCTOR_FORWARD_ARGS(ClassName, constructor_args_t); \
138 inline void constructor_post_init(void) \
167#define BBM_CONSTRUCTOR(ClassName, Args, ...) \
168 using constructor_args_t = bbm::add_args_t<__VA_ARGS__>; \
170 BBM_CONSTRUCTOR_FORWARD_ARGS(ClassName, constructor_args_t); \
172 inline ClassName(const constructor_args_t& Args) \
#define ArgDef(value)
Helper Macro for creating the type of a lambda that returns a value.
Definition: arg.h:259
Provides a more flexible argument passing to function and methods.
Definition: aggregatebsdf.h:29
typename bbm::detail::attribute_tuple_to_args_t< std::decay_t< TUP > >::type attribute_tuple_to_args_t
Convert an attribute_tuple_t to a bbm::args.
Definition: constructor.h:90
Forward declaration of bbm::arg.
Definition: arg.h:27
Forward declaration.
Definition: args.h:248
Compile-time reflection of: