From e2a56fa18aa34f3dfbe98f6121b19279c1e82146 Mon Sep 17 00:00:00 2001 From: neargye Date: Tue, 12 May 2020 13:48:55 +0500 Subject: [PATCH] update doc --- doc/limitations.md | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/doc/limitations.md b/doc/limitations.md index 0369b05..5aad519 100644 --- a/doc/limitations.md +++ b/doc/limitations.md @@ -54,19 +54,7 @@ } // namespace nameof ``` -* If you hit a message like this: - - ```text - [...] - note: constexpr evaluation hit maximum step limit; possible infinite loop? - ``` - - Change the limit for the number of constexpr evaluated: - * MSVC `/constexpr:depthN`, `/constexpr:stepsN` - * Clang `-fconstexpr-depth=N`, `-fconstexpr-steps=N` - * GCC `-fconstexpr-depth=N`, `-fconstexpr-loop-limit=N`, `-fconstexpr-ops-limit=N` - -* Nameof enum obtains the first defined value enums, and won't work if value are aliased. +* Nameof enum won't work if a value is aliased, work with enum-aliases is compiler-implementation-defined. ```cpp enum ShapeKind { @@ -78,11 +66,11 @@ Banana = 3, COUNT = 4, }; - // nameof::nameof_enum(ShapeKind::Box) -> "ConvexBegin" - // NAMEOF_ENUM(ShapeKind::Box) -> "ConvexBegin" + // nameof::nameof_enum(ShapeKind::Box) -> "ConvexBegin" or "" + // NAMEOF_ENUM(ShapeKind::Box) -> "ConvexBegin" or "" ``` - Work around the issue: + One of the possible workaround the issue: ```cpp enum ShapeKind { @@ -107,3 +95,17 @@ // nameof::nameof_enum(ShapeKind::ConvexBegin) -> "Box" // NAMEOF_ENUM(ShapeKind::ConvexBegin) -> "Box" ``` + +* If you hit a message like this: + + ```text + [...] + note: constexpr evaluation hit maximum step limit; possible infinite loop? + ``` + + Change the limit for the number of constexpr evaluated: + * MSVC `/constexpr:depthN`, `/constexpr:stepsN` + * Clang `-fconstexpr-depth=N`, `-fconstexpr-steps=N` + * GCC `-fconstexpr-depth=N`, `-fconstexpr-loop-limit=N`, `-fconstexpr-ops-limit=N` + +* Intellisense Visual Studio may have some problems analyzing `nameof`.