Category : enums

So I have a #define that creates a "MY_ENUM" #define MY_ENUM(ename, …) namespace ename { //Cool stuf } } This generates useful enums that can be created as: /** * @brief List of elements */ MY_ENUM(enuElements, Element1, Element2, Element3, Element4, Element5, Element6) But generating the doc with doxygen doesn’t seem to work => it mixes ..

Read more

Take the following: foo.h #ifndef FOO_H #define FOO_H #include <stdint.h> enum directions { NORTH, EAST, SOUTH, WEST }; bool foo_a(uint16_t a); bool foo_b(enum directions a); #endif //FOO_H foo.cpp #include "foo.h" #include <iostream> namespace test { bool foo_a(uint16_t a) { return a < 22; } bool foo_b(enum directions a) { return a < WEST; } bool ..

Read more

For my custom mesh class I defined an enum to consolidate valid arguments for the underlying draw call and noticed that the glbinding version of GLenum is "so strong" it forces my to perform multiple casts which is verbose: enum class EMeshPrimitive { Points = static_cast<UnsignedInt>(GL_POINTS), LineStrip = static_cast<UnsignedInt>(GL_LINE_STRIP), LineLoop = static_cast<UnsignedInt>(GL_LINE_LOOP), Lines = static_cast<UnsignedInt>(GL_LINES), ..

Read more

In my project, I have a header file containing the following lines. extern enum class options {alpha, beta, gamma, theta}; extern options P1, P2; Compilation gives me error: a storage class can only be specified for objects and functions Why? How can I rectify this? Compiler: GCC 9.2.0 Source: Windows Que..

Read more