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
copy_value.h
Go to the documentation of this file.
1
// Copyright (C) 2022 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4
#
pragma
once
5
6
#
include
"../../namespaces.h"
7
8
#
include
<
type_traits
>
9
10
namespace
QDOC_CATCH_GENERATORS_UTILITIES_ABSOLUTE_NAMESPACE
{
11
12
/*!
13
* Forces \value to be copied in an expression context.
14
*
15
* This is used in contexts where inferences of a type that
16
* requires generality might identify a reference when ownership
17
* is required.
18
*
19
* Note that the compiler might optmize the copy away. This is a
20
* non-issue as we are only interested in breaking lifetime
21
* dependencies.
22
*/
23
template
<
typename
T>
24
std
::remove_reference_t<T>
copy_value
(T value) {
return
value; }
25
26
}
// end QDOC_CATCH_GENERATORS_UTILITIES_ABSOLUTE_NAMESPACE
QDOC_CATCH_GENERATORS_UTILITIES_ABSOLUTE_NAMESPACE::copy_value
std::remove_reference_t< T > copy_value(T value)
Forces \value to be copied in an expression context.
Definition
copy_value.h:24
QDOC_CATCH_GENERATORS_UTILITIES_ABSOLUTE_NAMESPACE
#define QDOC_CATCH_GENERATORS_UTILITIES_ABSOLUTE_NAMESPACE
Definition
namespaces.h:14
std
Definition
qfloat16.h:492
qttools
src
qdoc
catch_generators
src
catch_generators
utilities
semantics
copy_value.h
Generated on Sat Sep 21 2024 01:06:17 for Qt by
1.12.0