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
q20functional.h
Go to the documentation of this file.
1
// Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Marc Mutz <marc.mutz@kdab.com>
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
#
ifndef
Q20FUNCTIONAL_H
5
#
define
Q20FUNCTIONAL_H
6
7
#
include
<
QtCore
/
qglobal
.
h
>
8
9
#
include
<
functional
>
10
11
//
12
// W A R N I N G
13
// -------------
14
//
15
// This file is not part of the Qt API. Types and functions defined in this
16
// file can reliably be replaced by their std counterparts, once available.
17
// You may use these definitions in your own code, but be aware that we
18
// will remove them once Qt depends on the C++ version that supports
19
// them in namespace std. There will be NO deprecation warning, the
20
// definitions will JUST go away.
21
//
22
// If you can't agree to these terms, don't use these definitions!
23
//
24
// We mean it.
25
//
26
27
#
include
<
functional
>
28
29
QT_BEGIN_NAMESPACE
30
31
namespace
q20
{
32
// like std::identity
33
#
ifdef
__cpp_lib_ranges
34
using
std
::
identity
;
35
#
else
36
struct
identity
37
{
38
struct
is_transparent
{};
39
template
<
typename
T>
40
constexpr
T &&
operator
()(T&& t)
const
noexcept
{
return
std
::forward<T>(t); }
41
};
42
#
endif
// __cpp_lib_ranges
43
}
// namespace q20
44
45
QT_END_NAMESPACE
46
47
#
endif
/* Q20FUNCTIONAL_H */
q20
Definition
qnumeric.cpp:464
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
q20::identity::is_transparent
Definition
q20functional.h:38
q20::identity
Definition
q20functional.h:37
q20::identity::operator()
constexpr T && operator()(T &&t) const noexcept
Definition
q20functional.h:40
qtbase
src
corelib
global
q20functional.h
Generated on
for Qt by
1.16.1