From 71b8d3d946088e599620e4a2e337a17b517907e1 Mon Sep 17 00:00:00 2001 From: terik23 Date: Mon, 22 Jul 2019 00:13:47 +0500 Subject: [PATCH] update example --- example/example.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/example/example.cpp b/example/example.cpp index 54b61d2..8818625 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -66,7 +66,7 @@ class SomeClass { template C SomeMethod6() const { C t{}; - std::cout << NAMEOF_VAR_TYPE(t) << std::endl; + std::cout << NAMEOF_TYPE_EXPR(t) << std::endl; return t; } }; @@ -116,14 +116,16 @@ int main() { // Nameof variable type. std::cout << nameof::nameof_type() << std::endl; // 'SomeStruct' - std::cout << NAMEOF_VAR_TYPE(structvar) << std::endl; // 'SomeStruct' - std::cout << NAMEOF_VAR_TYPE(SomeClass{}) << std::endl; // 'SomeClass' - std::cout << NAMEOF_VAR_TYPE(othervar.ll) << std::endl; // 'Long::LL' + 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__'