diff --git a/oi/FuncGen.cpp b/oi/FuncGen.cpp index fbe6658..11298ca 100644 --- a/oi/FuncGen.cpp +++ b/oi/FuncGen.cpp @@ -625,11 +625,11 @@ template constexpr inst::Field make_field(std::string_view name) { return inst::Field{ sizeof(T), - ExclusiveSizeProvider::size, + ExclusiveSizeProvider>::size, name, - NameProvider::names, - TypeHandler::fields, - TypeHandler::processors, + NameProvider>::names, + TypeHandler>::fields, + TypeHandler>::processors, std::is_fundamental_v, }; } diff --git a/test/integration/std_smart_ptr.toml b/test/integration/std_smart_ptr.toml index c9ab383..d0bddb6 100644 --- a/test/integration/std_smart_ptr.toml +++ b/test/integration/std_smart_ptr.toml @@ -32,6 +32,31 @@ definitions = ''' } ] ''' + [cases.unique_ptr_const_uint64_empty] + param_types = ["std::unique_ptr&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 8, + "dynamicSize": 0, + "exclusiveSize": 8, + "length": 0, + "capacity": 1, + "elementStaticSize": 8 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 8, + "exclusiveSize": 8, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.unique_ptr_uint64_present] param_types = ["std::unique_ptr&"] setup = "return {std::make_unique(64)};" @@ -82,6 +107,30 @@ definitions = ''' } ] ''' + [cases.unique_ptr_const_vector_empty] + param_types = ["std::unique_ptr>&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 8, + "dynamicSize": 0, + "length": 0, + "capacity": 1, + "elementStaticSize": 24 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 8, + "exclusiveSize": 8, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.unique_ptr_vector_present] param_types = ["std::unique_ptr>&"] setup = "return {std::make_unique>(std::initializer_list({1,2,3,4,5}))};" @@ -188,6 +237,30 @@ definitions = ''' } ] ''' + [cases.shared_ptr_const_uint64_empty] + param_types = ["std::shared_ptr&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 16, + "dynamicSize": 0, + "length": 0, + "capacity": 1, + "elementStaticSize": 8 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 16, + "exclusiveSize": 16, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.shared_ptr_uint64_present] param_types = ["std::shared_ptr&"] setup = "return std::make_shared(64);" @@ -241,6 +314,30 @@ definitions = ''' } ] ''' + [cases.shared_ptr_const_vector_empty] + param_types = ["std::shared_ptr>&"] + setup = "return {nullptr};" + expect_json = ''' + [ + { + "staticSize": 16, + "dynamicSize": 0, + "length": 0, + "capacity": 1, + "elementStaticSize": 24 + } + ] + ''' + expect_json_v2 = ''' + [ + { + "staticSize": 16, + "exclusiveSize": 16, + "length": 0, + "capacity": 1 + } + ] + ''' [cases.shared_ptr_vector_present] param_types = ["std::shared_ptr>&"] setup = "return std::make_shared>(std::initializer_list({1,2,3,4,5}));" diff --git a/types/shrd_ptr_type.toml b/types/shrd_ptr_type.toml index 3439bf3..ab42eef 100644 --- a/types/shrd_ptr_type.toml +++ b/types/shrd_ptr_type.toml @@ -60,7 +60,7 @@ el.pointer = std::get(d.val).value; type = """ types::st::Sum, - typename TypeHandler::type> + typename TypeHandler>::type> """ func = """ #ifdef __GLIBCXX__ diff --git a/types/uniq_ptr_type.toml b/types/uniq_ptr_type.toml index f71cff4..90663a4 100644 --- a/types/uniq_ptr_type.toml +++ b/types/uniq_ptr_type.toml @@ -61,7 +61,7 @@ el.pointer = std::get(d.val).value; type = """ types::st::Sum, - typename TypeHandler::type> + typename TypeHandler>::type> """ func = """ auto sum = std::get(d.val);