0

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 */ }();
}
screwnut
  • 1,367
  • 7
  • 26

0 Answers0