Просмотр исходного кода

meta: std::get<1>-table properties are no longer accepted, only std::pair is supported

Michele Caini 6 лет назад
Родитель
Сommit
5ad4079dbf
2 измененных файлов с 3 добавлено и 4 удалено
  1. 1 1
      docs/md/meta.md
  2. 2 3
      src/entt/meta/factory.hpp

+ 1 - 1
docs/md/meta.md

@@ -497,7 +497,7 @@ Furthermore, the `prop` function supports different formats for properties:
   entt::meta<my_type>().type("reflected_type"_hs).prop("tooltip"_hs, "message");
   ```
 
-* Properties as _`std::get<1>`-table_ objects:
+* Properties as `std::pair`s:
 
   ```cpp
   entt::meta<my_type>().type("reflected_type"_hs).prop(std::make_pair("tooltip"_hs, "message"));

+ 2 - 3
src/entt/meta/factory.hpp

@@ -696,9 +696,8 @@ class extended_meta_factory: public meta_factory<Type> {
         return node && (node->key() == key || duplicate(key, node->next));
     }
 
-    template<typename Property>
-    auto unpack(int, Property &&property)
-    -> decltype(std::get<1>(property), void()) {
+    template<typename... Property>
+    void unpack(int, std::pair<Property...> property) {
         unpack(0, std::get<0>(property), std::get<1>(property));
     }