The library is cross-platform and open-source under the MIT license, which means you can do with it whatever you wish. It comes with a readme which contains an explanation and usage examples, as well as a reference to the two main classes.
The idea is a container (a hash map) where the keys are strings and the values are a variant type wrapping boost::variant. Each cell can hold a bool, char, int, float or std::string.
You can initialize the container from a text file of a convenient format (Each line is <type> <name> <value>).
What we used this library in our project, was basically reading data / parameters from a text file, without the need to recompile when any of the data changed (Which is obvious) or when we needed new variables (Which is not as obvious). For example:
Let's say that I have a Car class with several parameters. One of the member instances of the Car class will be a BitBucket, and in the Car constructor I'll initialize it from a text file. So the contents of the file will be:
int mph 155 float to60 3.5 bool manual true auto vendor BMW // auto works like in C++11
If I wish to now add another parameter which is the car name, I can just add another line to the text file:
string name M3
Then reference the name in new code:
std::cout << "Car's name: " << bucket["name"] << std::endl;
And no other change or recompilation is needed. The new value will just be available to be used automagically.
You can also use the underlying class directly:
Bit x = 5; x = "Why not Zoidberg?"; std::cout << x << std::endl; var y = 3.14f; // You may use var instead of Bit if that tickles your fancy float yIntrinsic = y; yIntrinsic *= 2;
I posted this so that others might benefit from the idea, or pull request and improve it.
Finally, I would love to get a discussion going:
Do you think something like this is useful?
Can you think of other usage examples, other than what I described above?
Can you think of other communities I should post this at, so that more people might benefit from this?