Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
q20atomic.h
Go to the documentation of this file.
1
// Copyright (C) 2026 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
Q20ATOMIC_H
6
#
define
Q20ATOMIC_H
7
8
#
include
<
QtCore
/
qtconfigmacros
.
h
>
9
10
#
include
<
atomic
>
11
12
//
13
// W A R N I N G
14
// -------------
15
//
16
// This file is not part of the Qt API. Types and functions defined in this
17
// file can reliably be replaced by their std counterparts, once available.
18
// You may use these definitions in your own code, but be aware that we
19
// will remove them once Qt depends on the C++ version that supports
20
// them in namespace std. There will be NO deprecation warning, the
21
// definitions will JUST go away.
22
//
23
// If you can't agree to these terms, don't use these definitions!
24
//
25
// We mean it.
26
//
27
28
QT_BEGIN_NAMESPACE
29
30
namespace
q20
{
31
32
// This only ensures fixed initialization, nothing else (e.g. no wait/notify):
33
#
ifdef
__cpp_lib_atomic_value_initialization
34
template
<
class
T
>
35
using
atomic
=
std
::
atomic
<
T
>;
36
#
else
37
template
<
class
T>
38
class
atomic
:
public
std
::atomic<T>
39
{
40
public
:
41
using
std
::atomic<T>::
atomic
;
42
constexpr
atomic
()
noexcept
(
noexcept
(
std
::
atomic
<
T
>(
T
()))) :
std
::atomic<T>(T()) { }
43
};
44
45
template
<
class
T>
46
atomic
(T) ->
atomic
<T>;
47
#
endif
48
49
}
// namespace q20
50
51
QT_END_NAMESPACE
52
53
#
endif
/* Q20ATOMIC_H */
q20::atomic
Definition
q20atomic.h:39
q20::atomic::atomic
constexpr atomic() noexcept(noexcept(std::atomic< T >(T())))
Definition
q20atomic.h:42
q20
Definition
qnumeric.cpp:464
q20::atomic
atomic(T) -> atomic< T >
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
qtbase
src
corelib
global
q20atomic.h
Generated on
for Qt by
1.16.1