fork(7) download
  1. #include <mutex>
  2.  
  3. template <typename Mutex>
  4. static std::lock_guard<Mutex> lock_guard(Mutex &mutex)
  5. {
  6. mutex.lock();
  7. return {mutex,std::adopt_lock};
  8. }
  9.  
  10. int main()
  11. {
  12. std::mutex m;
  13. auto&& lock = lock_guard(m);
  14. }
Success #stdin #stdout 0s 3292KB
stdin
Standard input is empty
stdout
Standard output is empty