QT_NO_AS_CONST: rename and add docs
Give it a name in line with the function name: qAsConst -> QT_NO_QASCONST, as already done for qExchange. We can do this because we never documented the macro itself. So, while at it: also document the macro. Change-Id: I6eb0834df438e4f4e818ef2cf8e702ed156dc253 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
5fe805dcfb
commit
03baf08d2b
@ -156,7 +156,7 @@ qt_internal_add_target_aliases(PlatformToolInternal)
|
|||||||
target_link_libraries(PlatformToolInternal INTERFACE PlatformAppInternal)
|
target_link_libraries(PlatformToolInternal INTERFACE PlatformAppInternal)
|
||||||
|
|
||||||
qt_internal_add_global_definition(QT_NO_JAVA_STYLE_ITERATORS)
|
qt_internal_add_global_definition(QT_NO_JAVA_STYLE_ITERATORS)
|
||||||
qt_internal_add_global_definition(QT_NO_AS_CONST)
|
qt_internal_add_global_definition(QT_NO_QASCONST)
|
||||||
qt_internal_add_global_definition(QT_NO_QEXCHANGE)
|
qt_internal_add_global_definition(QT_NO_QEXCHANGE)
|
||||||
qt_internal_add_global_definition(QT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
|
qt_internal_add_global_definition(QT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
|
||||||
qt_internal_add_global_definition(QT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH)
|
qt_internal_add_global_definition(QT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH)
|
||||||
|
@ -24,7 +24,7 @@ constexpr std::underlying_type_t<Enum> qToUnderlying(Enum e) noexcept
|
|||||||
return static_cast<std::underlying_type_t<Enum>>(e);
|
return static_cast<std::underlying_type_t<Enum>>(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef QT_NO_AS_CONST
|
#ifndef QT_NO_QASCONST
|
||||||
#if QT_DEPRECATED_SINCE(6, 6)
|
#if QT_DEPRECATED_SINCE(6, 6)
|
||||||
|
|
||||||
// this adds const to non-const objects (like std::as_const)
|
// this adds const to non-const objects (like std::as_const)
|
||||||
@ -36,7 +36,7 @@ template <typename T>
|
|||||||
void qAsConst(const T &&) = delete;
|
void qAsConst(const T &&) = delete;
|
||||||
|
|
||||||
#endif // QT_DEPRECATED_SINCE(6, 6)
|
#endif // QT_DEPRECATED_SINCE(6, 6)
|
||||||
#endif // QT_NO_AS_CONST
|
#endif // QT_NO_QASCONST
|
||||||
|
|
||||||
#ifndef QT_NO_QEXCHANGE
|
#ifndef QT_NO_QEXCHANGE
|
||||||
|
|
||||||
|
@ -54,6 +54,20 @@
|
|||||||
|
|
||||||
To prevent this construct from compiling (and failing at runtime), qAsConst() has
|
To prevent this construct from compiling (and failing at runtime), qAsConst() has
|
||||||
a second, deleted, overload which binds to rvalues.
|
a second, deleted, overload which binds to rvalues.
|
||||||
|
|
||||||
|
\note You can make the qAsConst() function unavailable by defining
|
||||||
|
the \l{QT_NO_QASCONST} macro.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\macro QT_NO_QASCONST
|
||||||
|
\since 6.8
|
||||||
|
\relates <QtTypeTraits>
|
||||||
|
|
||||||
|
Defining this macro removes the availability of the qAsConst()
|
||||||
|
function.
|
||||||
|
|
||||||
|
\sa qAsConst
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user