diff --git a/examples/inheritance.cpp b/examples/inheritance.cpp index 4866a7c..3986aa1 100644 --- a/examples/inheritance.cpp +++ b/examples/inheritance.cpp @@ -95,14 +95,12 @@ namespace bitsery { // and Derived2 member fnc we need explicitly select which function to use template<> struct SelectSerializeFnc : UseMemberFnc -{ -}; +{}; // multiple inheritance has non-member serialize function defined template<> struct SelectSerializeFnc : UseNonMemberFnc -{ -}; +{}; } // some helper types diff --git a/examples/smart_pointers_with_polymorphism.cpp b/examples/smart_pointers_with_polymorphism.cpp index 6412cd7..ccbd5d4 100644 --- a/examples/smart_pointers_with_polymorphism.cpp +++ b/examples/smart_pointers_with_polymorphism.cpp @@ -191,14 +191,12 @@ namespace ext { template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; } } diff --git a/include/bitsery/details/adapter_common.h b/include/bitsery/details/adapter_common.h index dda97c1..959da98 100644 --- a/include/bitsery/details/adapter_common.h +++ b/include/bitsery/details/adapter_common.h @@ -145,10 +145,7 @@ struct SwapImpl return static_cast((value & 0x00ff) << 8 | (value & 0xff00) >> 8); } - static uint8_t exec(uint8_t value) - { - return value; - } + static uint8_t exec(uint8_t value) { return value; } }; template diff --git a/include/bitsery/details/not_defined_type.h b/include/bitsery/details/not_defined_type.h index defe57f..75a099e 100644 --- a/include/bitsery/details/not_defined_type.h +++ b/include/bitsery/details/not_defined_type.h @@ -62,8 +62,7 @@ struct NotDefinedType template struct IsDefined : public std::integral_constant::value> -{ -}; +{}; } } diff --git a/include/bitsery/details/serialization_common.h b/include/bitsery/details/serialization_common.h index b97ce1e..7c15d3a 100644 --- a/include/bitsery/details/serialization_common.h +++ b/include/bitsery/details/serialization_common.h @@ -70,24 +70,19 @@ struct FtorExtValue : public Ext template struct FtorExtValue1b : FtorExtValue<1, Ext> -{ -}; +{}; template struct FtorExtValue2b : FtorExtValue<2, Ext> -{ -}; +{}; template struct FtorExtValue4b : FtorExtValue<4, Ext> -{ -}; +{}; template struct FtorExtValue8b : FtorExtValue<8, Ext> -{ -}; +{}; template struct FtorExtValue16b : FtorExtValue<16, Ext> -{ -}; +{}; template struct FtorExtObject : public Ext @@ -105,8 +100,7 @@ struct FtorExtObject : public Ext // SelectSerializeFnc:UseMemberFnc {}; template struct SelectSerializeFnc : std::integral_constant -{ -}; +{}; // types you need to inherit from when specializing SelectSerializeFnc class struct UseNonMemberFnc : std::integral_constant @@ -120,20 +114,17 @@ namespace details { template struct IsContainerTraitsDefined : public IsDefined::TValue> -{ -}; +{}; template struct IsTextTraitsDefined : public IsDefined::TValue> -{ -}; +{}; template struct IsExtensionTraitsDefined : public IsDefined::TValue> -{ -}; +{}; #ifdef _MSC_VER // helper types for HasSerializeFunction @@ -151,8 +142,7 @@ struct HasSerializeFunctionHelper }; template struct HasSerializeFunction : HasSerializeFunctionHelper::type -{ -}; +{}; // helper types for HasSerializeMethod template @@ -169,8 +159,7 @@ struct HasSerializeMethodHelper }; template struct HasSerializeMethod : HasSerializeMethodHelper::type -{ -}; +{}; // helper types for IsBriefSyntaxIncluded template @@ -188,8 +177,7 @@ struct IsBriefSyntaxIncludedHelper template struct IsBriefSyntaxIncluded : IsBriefSyntaxIncludedHelper::type -{ -}; +{}; #else // helper metafunction, that is added to c++17 template @@ -202,8 +190,7 @@ using void_t = typename make_void::type; template struct HasSerializeFunction : std::false_type -{ -}; +{}; template struct HasSerializeFunction< @@ -211,13 +198,11 @@ struct HasSerializeFunction< T, void_t(), std::declval()))>> : std::true_type -{ -}; +{}; template struct HasSerializeMethod : std::false_type -{ -}; +{}; template struct HasSerializeMethod< @@ -225,14 +210,12 @@ struct HasSerializeMethod< T, void_t(), std::declval()))>> : std::true_type -{ -}; +{}; // this solution doesn't work with visual studio, but is more elegant template struct IsBriefSyntaxIncluded : std::false_type -{ -}; +{}; template struct IsBriefSyntaxIncluded< @@ -240,8 +223,7 @@ struct IsBriefSyntaxIncluded< T, void_t(), std::declval()))>> : std::true_type -{ -}; +{}; #endif // used for extensions when extension TValue = void @@ -257,8 +239,7 @@ struct IsFundamentalType std::is_enum::value || std::is_floating_point::value || std::is_integral::value> -{ -}; +{}; template struct IntegralFromFundamental @@ -372,16 +353,14 @@ struct BriefSyntaxFunction template struct FindIndex : std::integral_constant -{ -}; +{}; template struct FindIndex : std::conditional, FindIndex>::type -{ -}; +{}; template struct GetConvertibleTypeIndexFromTuple; @@ -389,8 +368,7 @@ struct GetConvertibleTypeIndexFromTuple; template struct GetConvertibleTypeIndexFromTuple> : FindIndex<0, std::is_convertible...> -{ -}; +{}; template struct IsExistsConvertibleTupleType; @@ -401,8 +379,7 @@ struct IsExistsConvertibleTupleType> bool, GetConvertibleTypeIndexFromTuple>::value != sizeof...(Us)> -{ -}; +{}; /* * get context from internal or external, and check if it's convertible or not @@ -549,13 +526,11 @@ protected: template class Template> struct IsSpecializationOf : std::false_type -{ -}; +{}; template class Template, typename... Args> struct IsSpecializationOf, Template> : std::true_type -{ -}; +{}; } } diff --git a/include/bitsery/ext/utils/pointer_utils.h b/include/bitsery/ext/utils/pointer_utils.h index 753223e..dcebf97 100644 --- a/include/bitsery/ext/utils/pointer_utils.h +++ b/include/bitsery/ext/utils/pointer_utils.h @@ -329,8 +329,7 @@ public: : std::integral_constant< bool, RTTI::template isPolymorphic::TElement>()> - { - }; + {}; template using OwnershipType = std::integral_constant; diff --git a/include/bitsery/ext/utils/polymorphism_utils.h b/include/bitsery/ext/utils/polymorphism_utils.h index 27cc917..401c751 100644 --- a/include/bitsery/ext/utils/polymorphism_utils.h +++ b/include/bitsery/ext/utils/polymorphism_utils.h @@ -35,8 +35,7 @@ namespace ext { // helper type, that contains list of types template struct PolymorphicClassesList -{ -}; +{}; // specialize for your base class by deriving from PolymorphicDerivedClasses // with list of derivatives that DIRECTLY inherits from your base class. diff --git a/include/bitsery/traits/array.h b/include/bitsery/traits/array.h index acc28f2..f6b250e 100644 --- a/include/bitsery/traits/array.h +++ b/include/bitsery/traits/array.h @@ -32,14 +32,12 @@ namespace traits { template struct ContainerTraits> : public StdContainer, false, true> -{ -}; +{}; template struct BufferAdapterTraits> : public StdContainerForBufferAdapter> -{ -}; +{}; } } diff --git a/include/bitsery/traits/deque.h b/include/bitsery/traits/deque.h index 600e87c..c5a5d62 100644 --- a/include/bitsery/traits/deque.h +++ b/include/bitsery/traits/deque.h @@ -33,8 +33,7 @@ namespace traits { template struct ContainerTraits> : public StdContainer, true, false> -{ -}; +{}; } diff --git a/include/bitsery/traits/list.h b/include/bitsery/traits/list.h index 0ccb514..8fa8198 100644 --- a/include/bitsery/traits/list.h +++ b/include/bitsery/traits/list.h @@ -33,8 +33,7 @@ namespace traits { template struct ContainerTraits> : public StdContainer, true, false> -{ -}; +{}; } diff --git a/include/bitsery/traits/string.h b/include/bitsery/traits/string.h index 22a322d..68834ca 100644 --- a/include/bitsery/traits/string.h +++ b/include/bitsery/traits/string.h @@ -36,8 +36,7 @@ namespace traits { template struct ContainerTraits> : public StdContainer, true, true> -{ -}; +{}; template struct TextTraits> @@ -72,8 +71,7 @@ template struct BufferAdapterTraits> : public StdContainerForBufferAdapter< std::basic_string> -{ -}; +{}; } diff --git a/include/bitsery/traits/vector.h b/include/bitsery/traits/vector.h index 9568f7c..e8a05d3 100644 --- a/include/bitsery/traits/vector.h +++ b/include/bitsery/traits/vector.h @@ -32,21 +32,18 @@ namespace traits { template struct ContainerTraits> : public StdContainer, true, true> -{ -}; +{}; // bool vector is not contiguous, do not copy it directly to buffer template struct ContainerTraits> : public StdContainer, true, false> -{ -}; +{}; template struct BufferAdapterTraits> : public StdContainerForBufferAdapter> -{ -}; +{}; } diff --git a/tests/adapter.cpp b/tests/adapter.cpp index 1c188d2..f986386 100644 --- a/tests/adapter.cpp +++ b/tests/adapter.cpp @@ -306,8 +306,7 @@ using AdapterInputTypes = template class InputAll : public AdapterConfig -{ -}; +{}; TYPED_TEST_SUITE(InputAll, AdapterInputTypes, ); @@ -476,8 +475,7 @@ using AdapterOutputTypes = template class OutputAll : public AdapterConfig -{ -}; +{}; TYPED_TEST_SUITE(OutputAll, AdapterOutputTypes, ); diff --git a/tests/brief_syntax.cpp b/tests/brief_syntax.cpp index 754e43b..043e49d 100644 --- a/tests/brief_syntax.cpp +++ b/tests/brief_syntax.cpp @@ -38,9 +38,9 @@ #include #include #if __cplusplus > 201402L +#include #include #include -#include #if __cplusplus > 202002L #include #endif diff --git a/tests/not_default_constructible.cpp b/tests/not_default_constructible.cpp index 3bd8033..a3ff18f 100644 --- a/tests/not_default_constructible.cpp +++ b/tests/not_default_constructible.cpp @@ -320,8 +320,7 @@ namespace ext { template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; } } diff --git a/tests/serialization_container.cpp b/tests/serialization_container.cpp index 9c14205..df5989e 100644 --- a/tests/serialization_container.cpp +++ b/tests/serialization_container.cpp @@ -214,8 +214,7 @@ TYPED_TEST(SerializeContainerFixedSizeArithmeticTypes, ArithmeticValues) template class SerializeContainerFixedSizeCompositeTypes : public SerializeContainerFixedSizeArithmeticTypes -{ -}; +{}; using StaticContainersWithCompositeTypes = ::testing::Types, MyStruct1[4]>; diff --git a/tests/serialization_ext_inheritance.cpp b/tests/serialization_ext_inheritance.cpp index 644e3e2..eabdb42 100644 --- a/tests/serialization_ext_inheritance.cpp +++ b/tests/serialization_ext_inheritance.cpp @@ -356,13 +356,11 @@ struct DerivedMemberSerialize : public BaseNonMemberSerialize namespace bitsery { template<> struct SelectSerializeFnc : UseNonMemberFnc -{ -}; +{}; template<> struct SelectSerializeFnc : UseMemberFnc -{ -}; +{}; } TEST( diff --git a/tests/serialization_ext_pointer_polymorphic_types.cpp b/tests/serialization_ext_pointer_polymorphic_types.cpp index b240642..200ed3c 100644 --- a/tests/serialization_ext_pointer_polymorphic_types.cpp +++ b/tests/serialization_ext_pointer_polymorphic_types.cpp @@ -147,8 +147,7 @@ namespace ext { template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; // this is commented on purpose, to test scenario when base class is registered // (Base) but using instance of Derived1 which is not registered as base @@ -160,8 +159,7 @@ struct PolymorphicBaseClass template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; } } diff --git a/tests/serialization_ext_pointer_with_allocator.cpp b/tests/serialization_ext_pointer_with_allocator.cpp index 929cd4c..796b85a 100644 --- a/tests/serialization_ext_pointer_with_allocator.cpp +++ b/tests/serialization_ext_pointer_with_allocator.cpp @@ -152,14 +152,12 @@ namespace ext { template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; } } diff --git a/tests/serialization_ext_std_smart_ptr.cpp b/tests/serialization_ext_std_smart_ptr.cpp index 1f9e1cf..293a2cb 100644 --- a/tests/serialization_ext_std_smart_ptr.cpp +++ b/tests/serialization_ext_std_smart_ptr.cpp @@ -106,13 +106,11 @@ namespace ext { template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; template<> struct PolymorphicBaseClass : PolymorphicDerivedClasses -{ -}; +{}; } }