QContainerInfo: Detect presence of reserve()

This is handy if you want to reserve if possible or just fill the
container right away if not.

Task-number: QTBUG-112227
Change-Id: I3d085c1ce2448150bc044c3513572e02161244f4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
bb10
Ulf Hermann 2023-04-18 15:06:23 +02:00
parent a4168bd5e5
commit a3f2857ebc
1 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,11 @@ inline constexpr bool has_size_v = false;
template<typename C>
inline constexpr bool has_size_v<C, std::void_t<decltype(C().size())>> = true;
template<typename C, typename = void>
inline constexpr bool has_reserve_v = false;
template<typename C>
inline constexpr bool has_reserve_v<C, std::void_t<decltype(C().reserve(0))>> = true;
template<typename C, typename = void>
inline constexpr bool has_clear_v = false;
template<typename C>