-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add version to header #89
Comments
It's also good idea to add version/about functions that returns version string and short description of the library. |
@aggsol would - #define RANG_VERSION_MAJOR 3
#define RANG_VERSION_MINOR 1
#define RANG_VERSION_PATCH 0 format fine for you? @kingseva why not constexpr members inside cout << rang::version << rang::description; though I don't know if people really use versions like this 🤔. Anyways I'll add both in next version 👍 |
@agauniyal Fine for mie, I just need a way to manually check what version a header is. |
Added for next-release. |
I think it will be more convenient to place version macros is on top of the header not on the bottom 😄. Most of developers don't like to scroll down headers to see witch version of header they addded to the project. Also it's handy to use check version macros: #include <iostream>
#define RANG_VERSION_MAJOR 4
#define RANG_VERSION_MINOR 0
#define RANG_VERSION_PATCH 0
#define RANG_VER_CHECK(major,minor,patch) (((major) << 16) | ((minor) << 8) | (patch))
#define RANG_VER RANG_VER_CHECK(RANG_VERSION_MAJOR,RANG_VERSION_MINOR,RANG_VERSION_PATCH)
int main()
{
#if RANG_VER >= RANG_VER_CHECK(4,0,0)
std::cout << "Hello, rang 4 !\n";
#endif
} |
I usually copy the header into my projects but it is hard to track which version it is. How about adding a
#define RANG_VERSION
to it?The text was updated successfully, but these errors were encountered: