update readme
This commit is contained in:
parent
0d1826b9c4
commit
0a97a1e05a
1 changed files with 10 additions and 10 deletions
20
README.md
20
README.md
|
@ -80,15 +80,6 @@ Header-only C++17 library provides nameof macros and functions to obtain simple
|
||||||
nameof::nameof_type<T>() -> "int"
|
nameof::nameof_type<T>() -> "int"
|
||||||
```
|
```
|
||||||
|
|
||||||
* Nameof full (with template suffix)
|
|
||||||
```cpp
|
|
||||||
// Name of function.
|
|
||||||
NAMEOF_FULL(foo<int, float>()) -> "foo<int, float>"
|
|
||||||
|
|
||||||
// Name of member function.
|
|
||||||
NAMEOF_FULL(somevar.some_method<int>()) -> "some_method<int>"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Remarks
|
## Remarks
|
||||||
|
|
||||||
* Nameof returns `std::string_view`. If argument does not have name, returns empty string.
|
* Nameof returns `std::string_view`. If argument does not have name, returns empty string.
|
||||||
|
@ -101,7 +92,16 @@ Header-only C++17 library provides nameof macros and functions to obtain simple
|
||||||
#include <nameof.hpp>
|
#include <nameof.hpp>
|
||||||
```
|
```
|
||||||
|
|
||||||
* If you need of raw fully-qualified name, use NAMEOF_RAW.
|
* If you need name with template suffix, use NAMEOF_FULL.
|
||||||
|
```cpp
|
||||||
|
// Name of function.
|
||||||
|
NAMEOF_FULL(foo<int, float>()) -> "foo<int, float>"
|
||||||
|
|
||||||
|
// Name of member function.
|
||||||
|
NAMEOF_FULL(somevar.some_method<int>()) -> "some_method<int>"
|
||||||
|
```
|
||||||
|
|
||||||
|
* If you need raw fully-qualified name, use NAMEOF_RAW.
|
||||||
```cpp
|
```cpp
|
||||||
NAMEOF_RAW(somevar.somefield) -> "somevar.somefield"
|
NAMEOF_RAW(somevar.somefield) -> "somevar.somefield"
|
||||||
NAMEOF_RAW(&some_class::some_method<int>) -> "&some_class::some_method<int>"
|
NAMEOF_RAW(&some_class::some_method<int>) -> "&some_class::some_method<int>"
|
||||||
|
|
Loading…
Reference in a new issue