I've read other questions on StackOverflow about the subject but I'm not positive they answer this question which combines a few different details. Is the following code that initializes a local static const reference with a lambda thread-safe?
std::vector<int> a, b, c;
void foo()
{
static auto const& v = [](){ /* logic to return a or b or c */ }();
}