Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removing spurious text that snuck in below the fold.

...

[ISO/IEC 14882-2014]Subclause 6.8, "Ambiguity Resolution"
Subclause 8.2, "Ambiguity Resolution"
[Meyers 01]Item 6, "Be Alert for C++'s Most Vexing Parse"

 

...

#include <mutex>

#include <thread>

#include <vector>

 

static std::mutex m;

static int shared_resource;

 

void increment_by_42() {

  { std::unique_lock<std::mutex>(m);

    shared_resource += 42;

  }

}