I have a program, which has many ways to assign some parameters (variables) in a code. For example, I can get a parameter from input file and, in the same time, set it manually from command line. If neither input file, nor command line set the parameter I should print a warning message and use default value.
I'm looking for the way in C++ to implement such functionality. Form my point of view it should be class like this
Template <typename T>
class c_assigned_value
{
protected:
bool _assigned;
T _value;
public:
...
};
But I cannot find any implementation. Do you have any suggestion?