I want to create an enumeration with 255 elements as follows:
enum class MyEnum { Item0, Item1, //.... Item254, Item255 };
Is there a way to generate enumeration elements with a macro, rather than enumerate them at all?
Well, it looks like OP is after BOOST_PP_ENUM_PARAMS . I will not say that this is the best solution, but it works for an enumeration with values ββsuch as:
BOOST_PP_ENUM_PARAMS
enum class MyEnum { BOOST_PP_ENUM_PARAMS(256, Item) };
you can use shell script to generate them ... i think they won't change often
echo Item{0..255},
Source: https://habr.com/ru/post/1011809/More articles:Electronic electron-winstaller Install the installation path for Msi - windows-installerDevice Manager file manager is empty for Nougat emulator - androidVisualize pointcloud - opencvWScript.Shell Run gives "No application is associated with the specified file for this operation." when opening images. - wshC ++ type definition unclear - c ++NSOrderedSet response from server and master data - iosImport operation works on PyCharm, but not from the terminal - pythonHow to display download results in a notification in the Ionic Hybrid app? - angularjsSQL Injection with MySQL (fun call) - sqlSwitching the initialization stream to a subclass: Swift and SpriteKit - initializationAll Articles