update readme

This commit is contained in:
Neargye 2018-04-15 00:49:27 +05:00
parent 5ce969388d
commit f5d5d84dc5

View file

@ -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