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
parent
a4168bd5e5
commit
a3f2857ebc
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue