Warning, file /include/QtCore/qcontainerinfo.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QCONTAINERINFO_H
0005 #define QCONTAINERINFO_H
0006
0007 #include <QtCore/qglobal.h>
0008 #include <type_traits>
0009
0010 QT_BEGIN_NAMESPACE
0011
0012 namespace QContainerInfo {
0013
0014 template<typename C>
0015 using value_type = typename C::value_type;
0016
0017 template<typename C>
0018 using key_type = typename C::key_type;
0019
0020 template<typename C>
0021 using mapped_type = typename C::mapped_type;
0022
0023 template<typename C>
0024 using iterator = typename C::iterator;
0025
0026 template<typename C>
0027 using const_iterator = typename C::const_iterator;
0028
0029
0030 QT_WARNING_PUSH
0031 QT_WARNING_DISABLE_CLANG("-Wunused-const-variable")
0032
0033 template<typename C, typename = void>
0034 inline constexpr bool has_value_type_v = false;
0035 template<typename C>
0036 inline constexpr bool has_value_type_v<C, std::void_t<value_type<C>>> = true;
0037
0038 template<typename C, typename = void>
0039 inline constexpr bool has_key_type_v = false;
0040 template<typename C>
0041 inline constexpr bool has_key_type_v<C, std::void_t<key_type<C>>> = true;
0042
0043 template<typename C, typename = void>
0044 inline constexpr bool has_mapped_type_v = false;
0045 template<typename C>
0046 inline constexpr bool has_mapped_type_v<C, std::void_t<mapped_type<C>>> = true;
0047
0048 template<typename C, typename = void>
0049 inline constexpr bool has_size_v = false;
0050 template<typename C>
0051 inline constexpr bool has_size_v<C, std::void_t<decltype(C().size())>> = true;
0052
0053 template<typename C, typename = void>
0054 inline constexpr bool has_reserve_v = false;
0055 template<typename C>
0056 inline constexpr bool has_reserve_v<C, std::void_t<decltype(C().reserve(0))>> = true;
0057
0058 template<typename C, typename = void>
0059 inline constexpr bool has_clear_v = false;
0060 template<typename C>
0061 inline constexpr bool has_clear_v<C, std::void_t<decltype(C().clear())>> = true;
0062
0063 template<typename, typename = void>
0064 inline constexpr bool has_at_index_v = false;
0065 template<typename C>
0066 inline constexpr bool has_at_index_v<C, std::void_t<decltype(C().at(0))>> = true;
0067
0068 template<typename, typename = void>
0069 inline constexpr bool has_at_key_v = false;
0070 template<typename C>
0071 inline constexpr bool has_at_key_v<C, std::void_t<decltype(C().at(key_type<C>()))>> = true;
0072
0073 template<typename, typename = void>
0074 inline constexpr bool can_get_at_index_v = false;
0075 template<typename C>
0076 inline constexpr bool can_get_at_index_v<C, std::void_t<value_type<C>(decltype(C()[0]))>> = true;
0077
0078 template<typename, typename = void>
0079 inline constexpr bool can_set_at_index_v = false;
0080 template<typename C>
0081 inline constexpr bool can_set_at_index_v<C, std::void_t<decltype(C()[0] = value_type<C>())>> = true;
0082
0083 template<typename, typename = void>
0084 inline constexpr bool has_push_front_v = false;
0085 template<typename C>
0086 inline constexpr bool has_push_front_v<C, std::void_t<decltype(C().push_front(value_type<C>()))>> = true;
0087
0088 template<typename, typename = void>
0089 inline constexpr bool has_push_back_v = false;
0090 template<typename C>
0091 inline constexpr bool has_push_back_v<C, std::void_t<decltype(C().push_back(value_type<C>()))>> = true;
0092
0093 template<typename, typename = void>
0094 inline constexpr bool has_insert_v = false;
0095 template<typename C>
0096 inline constexpr bool has_insert_v<C, std::void_t<decltype(C().insert(value_type<C>()))>> = true;
0097
0098 template<typename, typename = void>
0099 inline constexpr bool has_pop_front_v = false;
0100 template<typename C>
0101 inline constexpr bool has_pop_front_v<C, std::void_t<decltype(C().pop_front())>> = true;
0102
0103 template<typename, typename = void>
0104 inline constexpr bool has_pop_back_v = false;
0105 template<typename C>
0106 inline constexpr bool has_pop_back_v<C, std::void_t<decltype(C().pop_back())>> = true;
0107
0108 template<typename, typename = void>
0109 inline constexpr bool has_iterator_v = false;
0110 template<typename C>
0111 inline constexpr bool has_iterator_v<C, std::void_t<iterator<C>>> = true;
0112
0113 template<typename, typename = void>
0114 inline constexpr bool has_const_iterator_v = false;
0115 template<typename C>
0116 inline constexpr bool has_const_iterator_v<C, std::void_t<const_iterator<C>>> = true;
0117
0118 template<typename, typename = void>
0119 inline constexpr bool can_set_value_at_iterator_v = false;
0120 template<typename C>
0121 inline constexpr bool can_set_value_at_iterator_v<C, std::void_t<decltype(*C().begin() = value_type<C>())>> = true;
0122
0123 template<typename, typename = void>
0124 inline constexpr bool can_set_mapped_at_iterator_v = false;
0125 template<typename C>
0126 inline constexpr bool can_set_mapped_at_iterator_v<C, std::void_t<decltype(*C().begin() = mapped_type<C>())>> = true;
0127
0128 template<typename, typename = void>
0129 inline constexpr bool can_insert_value_at_iterator_v = false;
0130 template<typename C>
0131 inline constexpr bool can_insert_value_at_iterator_v<C, std::void_t<decltype(C().insert(C().begin(), value_type<C>()))>> = true;
0132
0133 template<typename, typename = void>
0134 inline constexpr bool can_erase_at_iterator_v = false;
0135 template<typename C>
0136 inline constexpr bool can_erase_at_iterator_v<C, std::void_t<decltype(C().erase(C().begin()))>> = true;
0137
0138 template<typename, typename = void>
0139 inline constexpr bool can_erase_range_at_iterator_v = false;
0140 template<typename C>
0141 inline constexpr bool can_erase_range_at_iterator_v<C, std::void_t<decltype(C().erase(C().begin(), C().end()))>> = true;
0142
0143 template<typename, typename = void>
0144 inline constexpr bool can_get_at_key_v = false;
0145 template<typename C>
0146 inline constexpr bool can_get_at_key_v<C, std::void_t<mapped_type<C>(decltype(C()[key_type<C>()]))>> = true;
0147
0148 template<typename, typename = void>
0149 inline constexpr bool can_set_at_key_v = false;
0150 template<typename C>
0151 inline constexpr bool can_set_at_key_v<C, std::void_t<decltype(C()[key_type<C>()] = mapped_type<C>())>> = true;
0152
0153 template<typename, typename = void>
0154 inline constexpr bool can_erase_at_key_v = false;
0155 template<typename C>
0156 inline constexpr bool can_erase_at_key_v<C, std::void_t<decltype(C().erase(key_type<C>()))>> = true;
0157
0158 template<typename, typename = void>
0159 inline constexpr bool can_remove_at_key_v = false;
0160 template<typename C>
0161 inline constexpr bool can_remove_at_key_v<C, std::void_t<decltype(C().remove(key_type<C>()))>> = true;
0162
0163 template<typename, typename = void>
0164 inline constexpr bool can_insert_key_v = false;
0165 template<typename C>
0166 inline constexpr bool can_insert_key_v<C, std::void_t<decltype(C().insert(key_type<C>()))>> = true;
0167
0168 template<typename, typename = void>
0169 inline constexpr bool can_insert_pair_v = false;
0170 template<typename C>
0171 inline constexpr bool can_insert_pair_v<C, std::void_t<decltype(C().insert({key_type<C>(), mapped_type<C>()}))>> = true;
0172
0173 template<typename, typename = void>
0174 inline constexpr bool can_insert_key_mapped_v = false;
0175 template<typename C>
0176 inline constexpr bool can_insert_key_mapped_v<C, std::void_t<decltype(C().insert(key_type<C>(), mapped_type<C>()))>> = true;
0177
0178 template<typename, typename = void>
0179 inline constexpr bool has_contains_v = false;
0180 template<typename C>
0181 inline constexpr bool has_contains_v<C, std::void_t<decltype(bool(C().contains(key_type<C>())))>> = true;
0182
0183 template<typename, typename = void>
0184 inline constexpr bool has_find_v = false;
0185 template<typename C>
0186 inline constexpr bool has_find_v<C, std::void_t<decltype(C().find(key_type<C>()))>> = true;
0187
0188 template<typename, typename = void>
0189 inline constexpr bool iterator_dereferences_to_value_v = false;
0190 template<typename C>
0191 inline constexpr bool iterator_dereferences_to_value_v<C, std::void_t<decltype(value_type<C>(*C().begin()))>> = true;
0192
0193 template<typename, typename = void>
0194 inline constexpr bool iterator_has_key_v = false;
0195 template<typename C>
0196 inline constexpr bool iterator_has_key_v<C, std::void_t<decltype(key_type<C>(C().begin().key()))>> = true;
0197
0198 template<typename, typename = void>
0199 inline constexpr bool value_type_has_first_v = false;
0200 template<typename C>
0201 inline constexpr bool value_type_has_first_v<C, std::void_t<decltype(key_type<C>(value_type<C>().first))>> = true;
0202
0203 template<typename, typename = void>
0204 inline constexpr bool iterator_dereferences_to_key_v = false;
0205 template<typename C>
0206 inline constexpr bool iterator_dereferences_to_key_v<C, std::void_t<decltype(key_type<C>(*C().begin()))>> = true;
0207
0208 template<typename, typename = void>
0209 inline constexpr bool iterator_has_value_v = false;
0210 template<typename C>
0211 inline constexpr bool iterator_has_value_v<C, std::void_t<decltype(mapped_type<C>(C().begin().value()))>> = true;
0212
0213 template<typename, typename = void>
0214 inline constexpr bool value_type_has_second_v = false;
0215 template<typename C>
0216 inline constexpr bool value_type_has_second_v<C, std::void_t<decltype(mapped_type<C>(value_type<C>().second))>> = true;
0217
0218 template<typename, typename = void>
0219 inline constexpr bool iterator_dereferences_to_mapped_v = false;
0220 template<typename C>
0221 inline constexpr bool iterator_dereferences_to_mapped_v<C, std::void_t<decltype(mapped_type<C>(*C().begin()))>> = true;
0222
0223 QT_WARNING_POP
0224
0225 }
0226
0227 QT_END_NAMESPACE
0228
0229 #endif