mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-23 20:11:49 +01:00
Make ENUM_STRING
function static
`ENUM_STRING` can be used inside a `class`/`struct`/`union` for `enum`s contained within them. Making the function `static` allows doing this and doesn't require supplying a `this` pointer of the enclosing class for usage.
This commit is contained in:
parent
c2a6da6431
commit
4b9f99bb27
@ -15,7 +15,7 @@
|
|||||||
* @example ENUM_STRING(Example, { ENUM_CASE(A); ENUM_CASE(B); })
|
* @example ENUM_STRING(Example, { ENUM_CASE(A); ENUM_CASE(B); })
|
||||||
*/
|
*/
|
||||||
#define ENUM_STRING(name, cases) \
|
#define ENUM_STRING(name, cases) \
|
||||||
constexpr const char *ToString(name value) { \
|
constexpr static const char *ToString(name value) { \
|
||||||
using ENUM_TYPE = name; \
|
using ENUM_TYPE = name; \
|
||||||
switch (value) { \
|
switch (value) { \
|
||||||
cases \
|
cases \
|
||||||
|
Loading…
Reference in New Issue
Block a user