|
@@ -698,19 +698,25 @@ class extended_meta_factory: public meta_factory<Type> {
|
|
|
|
|
|
|
|
template<typename... Property, std::size_t... Index>
|
|
template<typename... Property, std::size_t... Index>
|
|
|
void unpack(std::tuple<Property...> property, std::index_sequence<Index...>) {
|
|
void unpack(std::tuple<Property...> property, std::index_sequence<Index...>) {
|
|
|
- (unpack(choice<2>, std::get<Index>(property)), ...);
|
|
|
|
|
|
|
+ (unpack(choice<3>, std::get<Index>(property)), ...);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
template<typename... Property>
|
|
template<typename... Property>
|
|
|
- void unpack(choice_t<2>, std::tuple<Property...> property) {
|
|
|
|
|
|
|
+ void unpack(choice_t<3>, std::tuple<Property...> property) {
|
|
|
unpack(std::move(property), std::index_sequence_for<Property...>{});
|
|
unpack(std::move(property), std::index_sequence_for<Property...>{});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
template<typename... KeyOrValue>
|
|
template<typename... KeyOrValue>
|
|
|
- void unpack(choice_t<1>, std::pair<KeyOrValue...> property) {
|
|
|
|
|
|
|
+ void unpack(choice_t<2>, std::pair<KeyOrValue...> property) {
|
|
|
unpack(choice<0>, std::move(property.first), std::move(property.second));
|
|
unpack(choice<0>, std::move(property.first), std::move(property.second));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ template<typename Func>
|
|
|
|
|
+ auto unpack(choice_t<1>, Func func)
|
|
|
|
|
+ -> decltype(unpack(choice<3>, func())) {
|
|
|
|
|
+ unpack(choice<3>, func());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
template<typename Key, typename... Value>
|
|
template<typename Key, typename... Value>
|
|
|
void unpack(choice_t<0>, Key &&key, Value &&... value) {
|
|
void unpack(choice_t<0>, Key &&key, Value &&... value) {
|
|
|
static auto property{std::make_tuple(std::forward<Key>(key), std::forward<Value>(value)...)};
|
|
static auto property{std::make_tuple(std::forward<Key>(key), std::forward<Value>(value)...)};
|
|
@@ -752,7 +758,7 @@ public:
|
|
|
template<typename PropertyOrKey, typename... Value>
|
|
template<typename PropertyOrKey, typename... Value>
|
|
|
auto prop(PropertyOrKey &&property_or_key, Value &&... value) {
|
|
auto prop(PropertyOrKey &&property_or_key, Value &&... value) {
|
|
|
static_assert(sizeof...(Value) <= 1);
|
|
static_assert(sizeof...(Value) <= 1);
|
|
|
- unpack(choice<2>, std::forward<PropertyOrKey>(property_or_key), std::forward<Value>(value)...);
|
|
|
|
|
|
|
+ unpack(choice<3>, std::forward<PropertyOrKey>(property_or_key), std::forward<Value>(value)...);
|
|
|
return *this;
|
|
return *this;
|
|
|
}
|
|
}
|
|
|
|
|
|