Something like this:
const std::string somevalue = [&](){ if (caseA) { return "Value A"; } else if (caseB) { return "Value B"; } else { return "Value C"; } }();