From 1e5a80db43abc28daf3165da0bcd3bbc598b6d32 Mon Sep 17 00:00:00 2001 From: neargye Date: Mon, 22 Jul 2019 15:58:52 +0500 Subject: [PATCH] update example --- example/example.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/example/example.cpp b/example/example.cpp index 8818625..dc0249f 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -93,6 +93,7 @@ int main() { auto color = Color::RED; std::cout << nameof::nameof_enum(color) << std::endl; // 'RED' std::cout << NAMEOF_ENUM(color) << std::endl; // 'RED' + std::cout << nameof::nameof_enum() << std::endl; // 'GREEN' // Nameof. std::cout << NAMEOF(structvar) << std::endl; // 'structvar' @@ -114,19 +115,18 @@ int main() { std::cout << NAMEOF_FULL(SomeMethod4) << std::endl; // 'SomeMethod4' std::cout << NAMEOF_FULL(&SomeClass::SomeMethod6) << std::endl; // 'SomeMethod6' + // Nameof type. + std::cout << nameof::nameof_type() << std::endl; // 'Long::LL' + std::cout << NAMEOF_TYPE(const Long::LL&) << std::endl; // 'Long::LL' + std::cout << nameof::nameof_full_type() << std::endl; // 'const Long::LL &' + std::cout << NAMEOF_FULL_TYPE(const Long::LL&) << std::endl; // 'const Long::LL &' + // Nameof variable type. std::cout << nameof::nameof_type() << std::endl; // 'SomeStruct' std::cout << NAMEOF_TYPE_EXPR(structvar) << std::endl; // 'SomeStruct' - std::cout << NAMEOF_TYPE_EXPR(othervar.ll) << std::endl; // 'Long::LL' std::cout << NAMEOF_TYPE_EXPR(std::declval>()) << std::endl; // 'SomeClass' std::cout << NAMEOF_FULL_TYPE_EXPR(std::declval>()) << std::endl; // 'const SomeClass &&' - // Nameof type. - std::cout << nameof::nameof_type>() << std::endl; // 'SomeClass' - std::cout << NAMEOF_TYPE(SomeClass) << std::endl; // 'SomeClass' - std::cout << NAMEOF_TYPE(Long::LL) << std::endl; // 'Long::LL' - std::cout << NAMEOF_FULL_TYPE(const Long::LL&) << std::endl; // 'const Long::LL &' - // Nameof macro. std::cout << NAMEOF(__LINE__) << std::endl; // '__LINE__' std::cout << NAMEOF(NAMEOF(structvar)) << std::endl; // 'NAMEOF'