Fix formatting issues with __VA_OPT__.

This commit is contained in:
Anthony Calandra
2024-10-12 22:56:34 -04:00
parent bbc4ea3e3d
commit 0e192a5e56
2 changed files with 4 additions and 4 deletions

View File

@@ -19,7 +19,7 @@ C++20 includes the following new language features:
- [lambda capture of parameter pack](#lambda-capture-of-parameter-pack) - [lambda capture of parameter pack](#lambda-capture-of-parameter-pack)
- [char8_t](#char8_t) - [char8_t](#char8_t)
- [constinit](#constinit) - [constinit](#constinit)
- [__VA_OPT__](#__VA_OPT__) - [\_\_VA\_OPT\_\_](#__VA_OPT__)
C++20 includes the following new library features: C++20 includes the following new library features:
- [concepts library](#concepts-library) - [concepts library](#concepts-library)
@@ -450,7 +450,7 @@ constinit const char* c = f(true); // OK
constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time. constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
``` ```
### `__VA_OPT__` ### \_\_VA\_OPT\_\_
Helps support variadic macros by evaluating to the given argument if the variadic macro is non-empty. Helps support variadic macros by evaluating to the given argument if the variadic macro is non-empty.
```c++ ```c++
#define F(...) f(0 __VA_OPT__(,) __VA_ARGS__) #define F(...) f(0 __VA_OPT__(,) __VA_ARGS__)

View File

@@ -18,7 +18,7 @@ C++20 includes the following new language features:
- [lambda capture of parameter pack](#lambda-capture-of-parameter-pack) - [lambda capture of parameter pack](#lambda-capture-of-parameter-pack)
- [char8_t](#char8_t) - [char8_t](#char8_t)
- [constinit](#constinit) - [constinit](#constinit)
- [__VA_OPT__](#__VA_OPT__) - [\_\_VA\_OPT\_\_](#__VA_OPT__)
C++20 includes the following new library features: C++20 includes the following new library features:
- [concepts library](#concepts-library) - [concepts library](#concepts-library)
@@ -554,7 +554,7 @@ constinit const char* c = f(true); // OK
constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time. constinit const char* d = g(false); // ERROR: `g` is not constexpr, so `d` cannot be evaluated at compile-time.
``` ```
### `__VA_OPT__` ### \_\_VA\_OPT\_\_
Helps support variadic macros by evaluating to the given argument if the variadic macro is non-empty. Helps support variadic macros by evaluating to the given argument if the variadic macro is non-empty.
```c++ ```c++
#define F(...) f(0 __VA_OPT__(,) __VA_ARGS__) #define F(...) f(0 __VA_OPT__(,) __VA_ARGS__)