diff --git a/CHANGELOG.md b/CHANGELOG.md index f5277f92..9daad3e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ different versioning scheme, following the Haskell community's * Add service/method annotations in C# for Comm and gRPC. * Add service/method metadata support in C++ for gRPC. +* C++ codegen now uses [`std::allocator_traits`](http://en.cppreference.com/w/cpp/memory/allocator_traits) + for rebinding allocator types. ### C++ ### diff --git a/compiler/src/Language/Bond/Codegen/TypeMapping.hs b/compiler/src/Language/Bond/Codegen/TypeMapping.hs index bca18da7..93acddfc 100644 --- a/compiler/src/Language/Bond/Codegen/TypeMapping.hs +++ b/compiler/src/Language/Bond/Codegen/TypeMapping.hs @@ -365,8 +365,8 @@ cppType (BT_UserDefined decl args) = declQualifiedTypeName decl <<>> (angles <$> -- C++ type mapping with custom allocator cppTypeCustomAlloc :: Builder -> Type -> TypeNameBuilder -cppTypeCustomAlloc alloc BT_String = pure $ "std::basic_string, typename " <> alloc <> "::rebind::other>" -cppTypeCustomAlloc alloc BT_WString = pure $ "std::basic_string, typename " <> alloc <> "::rebind::other>" +cppTypeCustomAlloc alloc BT_String = pure $ "std::basic_string, typename std::allocator_traits<" <> alloc <> ">::template rebind_alloc >" +cppTypeCustomAlloc alloc BT_WString = pure $ "std::basic_string, typename std::allocator_traits<" <> alloc <> ">::template rebind_alloc >" cppTypeCustomAlloc alloc BT_MetaName = cppTypeCustomAlloc alloc BT_String cppTypeCustomAlloc alloc BT_MetaFullName = cppTypeCustomAlloc alloc BT_String cppTypeCustomAlloc alloc (BT_List element) = "std::list<" <>> elementTypeName element <<>> ", " <>> allocator alloc element <<> ">" @@ -382,11 +382,11 @@ comparer t = ", std::less<" <>> elementTypeName t <<> ">, " allocator :: Builder -> Type -> TypeNameBuilder allocator alloc element = - "typename " <>> alloc <>> "::rebind<" <>> elementTypeName element <<> ">::other" + "typename std::allocator_traits<" <>> alloc <>> ">::template rebind_alloc<" <>> elementTypeName element <<> ">" pairAllocator :: Builder -> Type -> Type -> TypeNameBuilder pairAllocator alloc key value = - "typename " <>> alloc <>> "::rebind<" <>> "std::pair> elementTypeName key <<>> ", " <>> elementTypeName value <<> "> >::other" + "typename std::allocator_traits<" <>> alloc <>> ">::template rebind_alloc<" <>> "std::pair> elementTypeName key <<>> ", " <>> elementTypeName value <<> "> >" cppSyntaxFix :: Builder -> Builder cppSyntaxFix = fromLazyText . snd . L.foldr fixInvalid (' ', mempty) . toLazyText diff --git a/compiler/tests/generated/alias_with_allocator_reflection.h b/compiler/tests/generated/alias_with_allocator_reflection.h index c0f4961f..3c89eed2 100644 --- a/compiler/tests/generated/alias_with_allocator_reflection.h +++ b/compiler/tests/generated/alias_with_allocator_reflection.h @@ -34,7 +34,7 @@ namespace test 0, ::bond::reflection::optional_field_modifier, foo, - std::list::other>, + std::list::template rebind_alloc >, &foo::l, &s_l_metadata > {} l; @@ -44,7 +44,7 @@ namespace test 1, ::bond::reflection::optional_field_modifier, foo, - std::vector::other>, + std::vector::template rebind_alloc >, &foo::v, &s_v_metadata > {} v; @@ -54,7 +54,7 @@ namespace test 2, ::bond::reflection::optional_field_modifier, foo, - std::set, typename arena::rebind::other>, + std::set, typename std::allocator_traits::template rebind_alloc >, &foo::s, &s_s_metadata > {} s; @@ -64,7 +64,7 @@ namespace test 3, ::bond::reflection::optional_field_modifier, foo, - std::map, typename arena::rebind::other>, bool, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, bool> >::other>, + std::map, typename std::allocator_traits::template rebind_alloc >, bool, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, bool> > >, &foo::m, &s_m_metadata > {} m; @@ -74,7 +74,7 @@ namespace test 4, ::bond::reflection::optional_field_modifier, foo, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &foo::st, &s_st_metadata > {} st; @@ -84,7 +84,7 @@ namespace test 5, ::bond::reflection::optional_field_modifier, foo, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &foo::d, &s_d_metadata > {} d; @@ -94,7 +94,7 @@ namespace test 10, ::bond::reflection::optional_field_modifier, foo, - ::bond::maybe::other> >, + ::bond::maybe::template rebind_alloc > >, &foo::l1, &s_l1_metadata > {} l1; @@ -104,7 +104,7 @@ namespace test 11, ::bond::reflection::optional_field_modifier, foo, - ::bond::maybe::other> >, + ::bond::maybe::template rebind_alloc > >, &foo::v1, &s_v1_metadata > {} v1; @@ -114,7 +114,7 @@ namespace test 12, ::bond::reflection::optional_field_modifier, foo, - ::bond::maybe, typename arena::rebind::other> >, + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > >, &foo::s1, &s_s1_metadata > {} s1; @@ -124,7 +124,7 @@ namespace test 13, ::bond::reflection::optional_field_modifier, foo, - ::bond::maybe, typename arena::rebind::other>, bool, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, bool> >::other> >, + ::bond::maybe, typename std::allocator_traits::template rebind_alloc >, bool, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, bool> > > >, &foo::m1, &s_m1_metadata > {} m1; @@ -134,7 +134,7 @@ namespace test 14, ::bond::reflection::optional_field_modifier, foo, - ::bond::maybe, typename arena::rebind::other> >, + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > >, &foo::st1, &s_st1_metadata > {} st1; diff --git a/compiler/tests/generated/alias_with_allocator_types.h b/compiler/tests/generated/alias_with_allocator_types.h index 016db781..2268286f 100644 --- a/compiler/tests/generated/alias_with_allocator_types.h +++ b/compiler/tests/generated/alias_with_allocator_types.h @@ -21,17 +21,17 @@ namespace test struct foo { - std::list::other> l; - std::vector::other> v; - std::set, typename arena::rebind::other> s; - std::map, typename arena::rebind::other>, bool, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, bool> >::other> m; - std::basic_string, typename arena::rebind::other> st; - std::basic_string, typename arena::rebind::other> d; - ::bond::maybe::other> > l1; - ::bond::maybe::other> > v1; - ::bond::maybe, typename arena::rebind::other> > s1; - ::bond::maybe, typename arena::rebind::other>, bool, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, bool> >::other> > m1; - ::bond::maybe, typename arena::rebind::other> > st1; + std::list::template rebind_alloc > l; + std::vector::template rebind_alloc > v; + std::set, typename std::allocator_traits::template rebind_alloc > s; + std::map, typename std::allocator_traits::template rebind_alloc >, bool, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, bool> > > m; + std::basic_string, typename std::allocator_traits::template rebind_alloc > st; + std::basic_string, typename std::allocator_traits::template rebind_alloc > d; + ::bond::maybe::template rebind_alloc > > l1; + ::bond::maybe::template rebind_alloc > > v1; + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > > s1; + ::bond::maybe, typename std::allocator_traits::template rebind_alloc >, bool, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, bool> > > > m1; + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > > st1; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used @@ -70,13 +70,13 @@ namespace test : l(allocator), v(allocator), s(std::less(), allocator), - m(std::less, typename arena::rebind::other>>(), allocator), + m(std::less, typename std::allocator_traits::template rebind_alloc >>(), allocator), st(allocator), d("foo", allocator), l1(allocator), v1(allocator), s1(std::less(), allocator), - m1(std::less, typename arena::rebind::other>>(), allocator), + m1(std::less, typename std::allocator_traits::template rebind_alloc >>(), allocator), st1(allocator) { } diff --git a/compiler/tests/generated/allocator/alias_key_reflection.h b/compiler/tests/generated/allocator/alias_key_reflection.h index e72c6080..2cbd0846 100644 --- a/compiler/tests/generated/allocator/alias_key_reflection.h +++ b/compiler/tests/generated/allocator/alias_key_reflection.h @@ -25,7 +25,7 @@ namespace test 0, ::bond::reflection::optional_field_modifier, foo, - std::map, typename arena::rebind::other>, int32_t, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, int32_t> >::other>, + std::map, typename std::allocator_traits::template rebind_alloc >, int32_t, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, int32_t> > >, &foo::m, &s_m_metadata > {} m; @@ -35,7 +35,7 @@ namespace test 1, ::bond::reflection::optional_field_modifier, foo, - std::set, typename arena::rebind::other>, + std::set, typename std::allocator_traits::template rebind_alloc >, &foo::s, &s_s_metadata > {} s; diff --git a/compiler/tests/generated/allocator/alias_key_types.h b/compiler/tests/generated/allocator/alias_key_types.h index 7d2861bb..2ab06422 100644 --- a/compiler/tests/generated/allocator/alias_key_types.h +++ b/compiler/tests/generated/allocator/alias_key_types.h @@ -21,8 +21,8 @@ namespace test struct foo { - std::map, typename arena::rebind::other>, int32_t, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, int32_t> >::other> m; - std::set, typename arena::rebind::other> s; + std::map, typename std::allocator_traits::template rebind_alloc >, int32_t, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, int32_t> > > m; + std::set, typename std::allocator_traits::template rebind_alloc > s; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used @@ -48,7 +48,7 @@ namespace test explicit foo(const arena& allocator) - : m(std::less, typename arena::rebind::other>>(), allocator), + : m(std::less, typename std::allocator_traits::template rebind_alloc >>(), allocator), s(std::less(), allocator) { } diff --git a/compiler/tests/generated/allocator/aliases_reflection.h b/compiler/tests/generated/allocator/aliases_reflection.h index 9ef0d8a6..3fe4a7a0 100644 --- a/compiler/tests/generated/allocator/aliases_reflection.h +++ b/compiler/tests/generated/allocator/aliases_reflection.h @@ -25,7 +25,7 @@ namespace tests 0, ::bond::reflection::optional_field_modifier, Foo, - std::vector::other>, typename arena::rebind::other> >::other>, + std::vector::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc::template rebind_alloc > > >, &Foo::aa, &s_aa_metadata > {} aa; diff --git a/compiler/tests/generated/allocator/aliases_types.h b/compiler/tests/generated/allocator/aliases_types.h index 0314f41b..faea5092 100644 --- a/compiler/tests/generated/allocator/aliases_types.h +++ b/compiler/tests/generated/allocator/aliases_types.h @@ -22,7 +22,7 @@ namespace tests template struct Foo { - std::vector::other>, typename arena::rebind::other> >::other> aa; + std::vector::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc::template rebind_alloc > > > aa; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used diff --git a/compiler/tests/generated/allocator/attributes_reflection.h b/compiler/tests/generated/allocator/attributes_reflection.h index 8e3b6f14..dcd234d6 100644 --- a/compiler/tests/generated/allocator/attributes_reflection.h +++ b/compiler/tests/generated/allocator/attributes_reflection.h @@ -24,7 +24,7 @@ namespace tests 0, ::bond::reflection::optional_field_modifier, Foo, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &Foo::f, &s_f_metadata > {} f; diff --git a/compiler/tests/generated/allocator/attributes_types.h b/compiler/tests/generated/allocator/attributes_types.h index 53793ed4..bf5932b0 100644 --- a/compiler/tests/generated/allocator/attributes_types.h +++ b/compiler/tests/generated/allocator/attributes_types.h @@ -95,7 +95,7 @@ namespace tests struct Foo { - std::basic_string, typename arena::rebind::other> f; + std::basic_string, typename std::allocator_traits::template rebind_alloc > f; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used diff --git a/compiler/tests/generated/allocator/basic_types_reflection.h b/compiler/tests/generated/allocator/basic_types_reflection.h index 600e3194..a1bda05c 100644 --- a/compiler/tests/generated/allocator/basic_types_reflection.h +++ b/compiler/tests/generated/allocator/basic_types_reflection.h @@ -47,7 +47,7 @@ namespace tests 2, ::bond::reflection::optional_field_modifier, BasicTypes, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &BasicTypes::_str, &s__str_metadata > {} _str; @@ -57,7 +57,7 @@ namespace tests 3, ::bond::reflection::optional_field_modifier, BasicTypes, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &BasicTypes::_wstr, &s__wstr_metadata > {} _wstr; diff --git a/compiler/tests/generated/allocator/basic_types_types.h b/compiler/tests/generated/allocator/basic_types_types.h index 14f6faee..f17275f0 100644 --- a/compiler/tests/generated/allocator/basic_types_types.h +++ b/compiler/tests/generated/allocator/basic_types_types.h @@ -22,8 +22,8 @@ namespace tests struct BasicTypes { bool _bool; - std::basic_string, typename arena::rebind::other> _str; - std::basic_string, typename arena::rebind::other> _wstr; + std::basic_string, typename std::allocator_traits::template rebind_alloc > _str; + std::basic_string, typename std::allocator_traits::template rebind_alloc > _wstr; uint64_t _uint64; uint16_t _uint16; uint32_t _uint32; diff --git a/compiler/tests/generated/allocator/bond_meta_reflection.h b/compiler/tests/generated/allocator/bond_meta_reflection.h index a51a48c5..17912520 100644 --- a/compiler/tests/generated/allocator/bond_meta_reflection.h +++ b/compiler/tests/generated/allocator/bond_meta_reflection.h @@ -27,7 +27,7 @@ namespace bondmeta 0, ::bond::reflection::required_optional_field_modifier, HasMetaFields, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &HasMetaFields::full_name, &s_full_name_metadata > {} full_name; @@ -37,7 +37,7 @@ namespace bondmeta 1, ::bond::reflection::required_optional_field_modifier, HasMetaFields, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &HasMetaFields::name, &s_name_metadata > {} name; diff --git a/compiler/tests/generated/allocator/bond_meta_types.h b/compiler/tests/generated/allocator/bond_meta_types.h index 1600a782..dba3a94d 100644 --- a/compiler/tests/generated/allocator/bond_meta_types.h +++ b/compiler/tests/generated/allocator/bond_meta_types.h @@ -23,8 +23,8 @@ namespace bondmeta struct HasMetaFields { - std::basic_string, typename arena::rebind::other> full_name; - std::basic_string, typename arena::rebind::other> name; + std::basic_string, typename std::allocator_traits::template rebind_alloc > full_name; + std::basic_string, typename std::allocator_traits::template rebind_alloc > name; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used diff --git a/compiler/tests/generated/allocator/complex_types_reflection.h b/compiler/tests/generated/allocator/complex_types_reflection.h index a220636d..5b5461df 100644 --- a/compiler/tests/generated/allocator/complex_types_reflection.h +++ b/compiler/tests/generated/allocator/complex_types_reflection.h @@ -58,7 +58,7 @@ namespace tests 0, ::bond::reflection::optional_field_modifier, ComplexTypes, - std::list::other>, + std::list::template rebind_alloc >, &ComplexTypes::li8, &s_li8_metadata > {} li8; @@ -68,7 +68,7 @@ namespace tests 1, ::bond::reflection::optional_field_modifier, ComplexTypes, - std::set, typename arena::rebind::other>, + std::set, typename std::allocator_traits::template rebind_alloc >, &ComplexTypes::sb, &s_sb_metadata > {} sb; @@ -78,7 +78,7 @@ namespace tests 2, ::bond::reflection::optional_field_modifier, ComplexTypes, - std::vector< ::bond::blob, typename arena::rebind< ::bond::blob>::other>, + std::vector< ::bond::blob, typename std::allocator_traits::template rebind_alloc< ::bond::blob> >, &ComplexTypes::vb, &s_vb_metadata > {} vb; @@ -98,7 +98,7 @@ namespace tests 4, ::bond::reflection::optional_field_modifier, ComplexTypes, - std::map, typename arena::rebind::other>, std::basic_string, typename arena::rebind::other>, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, std::basic_string, typename arena::rebind::other> > >::other>, + std::map, typename std::allocator_traits::template rebind_alloc >, std::basic_string, typename std::allocator_traits::template rebind_alloc >, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, std::basic_string, typename std::allocator_traits::template rebind_alloc > > > >, &ComplexTypes::msws, &s_msws_metadata > {} msws; @@ -118,7 +118,7 @@ namespace tests 6, ::bond::reflection::optional_field_modifier, ComplexTypes, - std::map >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other>, typename arena::rebind >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other> >::other>, std::less, typename arena::rebind >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other>, typename arena::rebind >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other> >::other> > >::other>, + std::map >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > >, typename std::allocator_traits::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > > > >, std::less, typename std::allocator_traits::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > >, typename std::allocator_traits::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > > > > > > >, &ComplexTypes::m, &s_m_metadata > {} m; diff --git a/compiler/tests/generated/allocator/complex_types_types.h b/compiler/tests/generated/allocator/complex_types_types.h index 4b9e84f8..7d411627 100644 --- a/compiler/tests/generated/allocator/complex_types_types.h +++ b/compiler/tests/generated/allocator/complex_types_types.h @@ -86,13 +86,13 @@ namespace tests struct ComplexTypes { - std::list::other> li8; - std::set, typename arena::rebind::other> sb; - std::vector< ::bond::blob, typename arena::rebind< ::bond::blob>::other> vb; + std::list::template rebind_alloc > li8; + std::set, typename std::allocator_traits::template rebind_alloc > sb; + std::vector< ::bond::blob, typename std::allocator_traits::template rebind_alloc< ::bond::blob> > vb; ::bond::nullable nf; - std::map, typename arena::rebind::other>, std::basic_string, typename arena::rebind::other>, std::less, typename arena::rebind::other> >, typename arena::rebind, typename arena::rebind::other>, std::basic_string, typename arena::rebind::other> > >::other> msws; + std::map, typename std::allocator_traits::template rebind_alloc >, std::basic_string, typename std::allocator_traits::template rebind_alloc >, std::less, typename std::allocator_traits::template rebind_alloc > >, typename std::allocator_traits::template rebind_alloc, typename std::allocator_traits::template rebind_alloc >, std::basic_string, typename std::allocator_traits::template rebind_alloc > > > > msws; ::bond::bonded< ::tests::Foo> bfoo; - std::map >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other>, typename arena::rebind >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other> >::other>, std::less, typename arena::rebind >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other>, typename arena::rebind >, typename arena::rebind< ::bond::nullable< ::bond::bonded< ::tests::Bar> > >::other> >::other> > >::other> m; + std::map >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > >, typename std::allocator_traits::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > > > >, std::less, typename std::allocator_traits::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > >, typename std::allocator_traits::template rebind_alloc >, typename std::allocator_traits::template rebind_alloc< ::bond::nullable< ::bond::bonded< ::tests::Bar> > > > > > > > > m; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used @@ -127,7 +127,7 @@ namespace tests sb(std::less(), allocator), vb(allocator), nf(), - msws(std::less, typename arena::rebind::other>>(), allocator), + msws(std::less, typename std::allocator_traits::template rebind_alloc >>(), allocator), m(std::less(), allocator) { } diff --git a/compiler/tests/generated/allocator/defaults_reflection.h b/compiler/tests/generated/allocator/defaults_reflection.h index 7d59b778..0d88197c 100644 --- a/compiler/tests/generated/allocator/defaults_reflection.h +++ b/compiler/tests/generated/allocator/defaults_reflection.h @@ -89,7 +89,7 @@ namespace tests 3, ::bond::reflection::optional_field_modifier, Foo, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &Foo::m_str_1, &s_m_str_1_metadata > {} m_str_1; @@ -99,7 +99,7 @@ namespace tests 4, ::bond::reflection::optional_field_modifier, Foo, - ::bond::maybe, typename arena::rebind::other> >, + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > >, &Foo::m_str_2, &s_m_str_2_metadata > {} m_str_2; @@ -399,7 +399,7 @@ namespace tests 34, ::bond::reflection::optional_field_modifier, Foo, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &Foo::m_wstr_1, &s_m_wstr_1_metadata > {} m_wstr_1; @@ -409,7 +409,7 @@ namespace tests 35, ::bond::reflection::optional_field_modifier, Foo, - ::bond::maybe, typename arena::rebind::other> >, + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > >, &Foo::m_wstr_2, &s_m_wstr_2_metadata > {} m_wstr_2; diff --git a/compiler/tests/generated/allocator/defaults_types.h b/compiler/tests/generated/allocator/defaults_types.h index 9533e8a4..003b2e7d 100644 --- a/compiler/tests/generated/allocator/defaults_types.h +++ b/compiler/tests/generated/allocator/defaults_types.h @@ -108,8 +108,8 @@ namespace tests bool m_bool_1; bool m_bool_2; ::bond::maybe m_bool_3; - std::basic_string, typename arena::rebind::other> m_str_1; - ::bond::maybe, typename arena::rebind::other> > m_str_2; + std::basic_string, typename std::allocator_traits::template rebind_alloc > m_str_1; + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > > m_str_2; int8_t m_int8_4; ::bond::maybe m_int8_5; int16_t m_int16_4; @@ -139,8 +139,8 @@ namespace tests ::tests::EnumType1 m_enum_int32max; ::tests::EnumType1 m_enum_uint32_min; ::tests::EnumType1 m_enum_uint32_max; - std::basic_string, typename arena::rebind::other> m_wstr_1; - ::bond::maybe, typename arena::rebind::other> > m_wstr_2; + std::basic_string, typename std::allocator_traits::template rebind_alloc > m_wstr_1; + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > > m_wstr_2; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used diff --git a/compiler/tests/generated/allocator/with_enum_header_reflection.h b/compiler/tests/generated/allocator/with_enum_header_reflection.h index 7944334f..27e21024 100644 --- a/compiler/tests/generated/allocator/with_enum_header_reflection.h +++ b/compiler/tests/generated/allocator/with_enum_header_reflection.h @@ -89,7 +89,7 @@ namespace tests 3, ::bond::reflection::optional_field_modifier, Foo, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &Foo::m_str_1, &s_m_str_1_metadata > {} m_str_1; @@ -99,7 +99,7 @@ namespace tests 4, ::bond::reflection::optional_field_modifier, Foo, - ::bond::maybe, typename arena::rebind::other> >, + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > >, &Foo::m_str_2, &s_m_str_2_metadata > {} m_str_2; @@ -399,7 +399,7 @@ namespace tests 34, ::bond::reflection::optional_field_modifier, Foo, - std::basic_string, typename arena::rebind::other>, + std::basic_string, typename std::allocator_traits::template rebind_alloc >, &Foo::m_wstr_1, &s_m_wstr_1_metadata > {} m_wstr_1; @@ -409,7 +409,7 @@ namespace tests 35, ::bond::reflection::optional_field_modifier, Foo, - ::bond::maybe, typename arena::rebind::other> >, + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > >, &Foo::m_wstr_2, &s_m_wstr_2_metadata > {} m_wstr_2; diff --git a/compiler/tests/generated/allocator/with_enum_header_types.h b/compiler/tests/generated/allocator/with_enum_header_types.h index 8fcdebdf..0c60ebc4 100644 --- a/compiler/tests/generated/allocator/with_enum_header_types.h +++ b/compiler/tests/generated/allocator/with_enum_header_types.h @@ -93,8 +93,8 @@ namespace tests bool m_bool_1; bool m_bool_2; ::bond::maybe m_bool_3; - std::basic_string, typename arena::rebind::other> m_str_1; - ::bond::maybe, typename arena::rebind::other> > m_str_2; + std::basic_string, typename std::allocator_traits::template rebind_alloc > m_str_1; + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > > m_str_2; int8_t m_int8_4; ::bond::maybe m_int8_5; int16_t m_int16_4; @@ -124,8 +124,8 @@ namespace tests ::tests::EnumType1 m_enum_int32max; ::tests::EnumType1 m_enum_uint32_min; ::tests::EnumType1 m_enum_uint32_max; - std::basic_string, typename arena::rebind::other> m_wstr_1; - ::bond::maybe, typename arena::rebind::other> > m_wstr_2; + std::basic_string, typename std::allocator_traits::template rebind_alloc > m_wstr_1; + ::bond::maybe, typename std::allocator_traits::template rebind_alloc > > m_wstr_2; struct _bond_vc12_ctor_workaround_ {}; template // Workaround to avoid compilation if not used