Debian Codegraph @

libcxx/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/implicit_ctad.pass.cpp

raw
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // UNSUPPORTED: no-threads
10 // UNSUPPORTED: c++03, c++11, c++14
11
12 // <mutex>
13
14 // unique_lock
15
16 // Make sure that the implicitly-generated CTAD works.
17
18 #include <mutex>
19
20 #include "test_macros.h"
21
22 int main(int, char**) {
23 std::mutex mutex;
24 {
25 std::unique_lock lock(mutex);
26 ASSERT_SAME_TYPE(decltype(lock), std::unique_lock<std::mutex>);
27 }
28
29 return 0;
30 }