2

i am trying to get the string selected from a list (defined in the settings.ini with name [listname]) using this code:

unity::scopes::VariantMap config = settings();
std::string selected_string = config["listname"].get_string();

However it says this:

ScopeBase::run(): unity::LogicException: Variant does not contain a string value:
boost::bad_get: failed value get using boost::get

What does the Variant variable contain? How can i retrieve the selected entry?

1 Answer 1

3

Ok i just figured it out, the Variant contains an integer, so one should use:

config["listname"].get_int();

And then do the rest in the code (according to values order in settings.ini)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .