From bacbd608e4675e5ecb764af5372d71a6ffb9f427 Mon Sep 17 00:00:00 2001 From: kamchatka_volcano Date: Wed, 7 Dec 2022 00:08:56 +0300 Subject: [PATCH] fixes after the review --- include/nameof.hpp | 5 ++--- test/test.cpp | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/nameof.hpp b/include/nameof.hpp index f09b885..44230cc 100644 --- a/include/nameof.hpp +++ b/include/nameof.hpp @@ -979,9 +979,8 @@ union union_type { }; template -struct union_type_holder -{ - constexpr static union_type value; +struct union_type_holder { + constexpr static union_type value; }; template diff --git a/test/test.cpp b/test/test.cpp index 943d870..21223a8 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -118,6 +118,8 @@ struct TestRtti{ struct Derived : Base {}; }; +#if defined(NAMEOF_MEMBER_SUPPORTED) && NAMEOF_MEMBER_SUPPORTED + struct StructMemberInitializationUsingNameof{ std::string teststringfield = std::string{nameof::nameof_member<&StructMemberInitializationUsingNameof::teststringfield>()}; }; @@ -127,6 +129,8 @@ struct StructWithNonConstexprDestructor{ int somefield; }; +#endif + SomeStruct struct_var; Long othervar; SomeStruct* ptr_s = &struct_var;