update readme
This commit is contained in:
parent
5ce969388d
commit
f5d5d84dc5
1 changed files with 8 additions and 1 deletions
|
@ -15,7 +15,7 @@ master |[![Build Status](https://travis-ci.org/Neargye/nameof.svg?branch=master)
|
|||
|
||||
C++ alternative to [nameof](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/nameof) operator in [C#](https://en.wikipedia.org/wiki/C_Sharp_(programming_language)).
|
||||
|
||||
Used to obtain the simple name of a variable, type, member or function and etc.
|
||||
Used to obtain the simple name of a variable, type, member, function, macros and etc.
|
||||
Before, you had to use string literals to refer to definitions, which is brittle when renaming code elements because tools do not know to check these string literals.
|
||||
|
||||
A nameof macros expression has this form:
|
||||
|
@ -57,6 +57,13 @@ NAMEOF(volatile const int) -> "volatile const int int"
|
|||
NAMEOF(std::string) -> "string"
|
||||
```
|
||||
|
||||
* Name of macros
|
||||
|
||||
```cpp
|
||||
NAMEOF(__LINE__) -> "__LINE__"
|
||||
NAMEOF(__FILE__) -> "__FILE__"
|
||||
```
|
||||
|
||||
* Constexpr
|
||||
|
||||
```cpp
|
||||
|
|
Loading…
Reference in a new issue