Common use cases for macros over constexpr include:
* Compatibility with pre C++11 code, since constexpr was defined in C++11.
* Compatibility with libraries that make heavy use of the preprocessor, such as Boost.preprocessor
* Any library that requires preprocessor definitions to enable or disable different features.
* Allowing for build options: CMake and other compilers allow for setting preprocessor defines outside of the code, allowing for different options when building. Setting these to constexpr variables instead requires an additional .in configure_file in cmake to translate them, and may be unavailable for other build systems.
* Including different libraries depending on the operating system. Some C++ libraries are unix only, and require alternatives to work in windows. Since constexpr is used for setting the values of functions and variables, it can't be used for this.
* Setting different types depending on system: some architectures might work with different types more often, such as windows and wchar instead of char, or ulong vs ulonglong.
spam fails_task lang_mismatch pii not_appropriate hate_speech sexual_content quality toxicity humor helpfulness creativity violence