MySQL 9.6.0
Source Code Documentation
meta.h
Go to the documentation of this file.
1// Copyright (c) 2025, Oracle and/or its affiliates.
2//
3// This program is free software; you can redistribute it and/or modify
4// it under the terms of the GNU General Public License, version 2.0,
5// as published by the Free Software Foundation.
6//
7// This program is designed to work with certain software (including
8// but not limited to OpenSSL) that is licensed under separate terms,
9// as designated in a particular file or component or in included license
10// documentation. The authors of MySQL hereby grant you an additional
11// permission to link the program and your derivative works with the
12// separately licensed software that they have either included with
13// the program or referenced in the documentation.
14//
15// This program is distributed in the hope that it will be useful,
16// but WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License, version 2.0, for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with this program; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
23
24#ifndef MYSQL_ITERATORS_META_H
25#define MYSQL_ITERATORS_META_H
26
27/// @file
28/// Experimental API header
29
30#include <iterator> // iterator_traits
31
32/// @addtogroup GroupLibsMysqlIterators
33/// @{
34
35namespace mysql::iterators {
36
37// The type tag for the strongest of the standard iterator categories that
38// Iterator_t satisfies.
39template <class Iterator_t>
40using Iterator_concept_tag = std::conditional_t<
41 std::contiguous_iterator<Iterator_t>, std::contiguous_iterator_tag,
42 std::conditional_t<
43 std::random_access_iterator<Iterator_t>,
44 std::random_access_iterator_tag,
45 std::conditional_t<
46 std::bidirectional_iterator<Iterator_t>,
47 std::bidirectional_iterator_tag,
48 std::conditional_t<
49 std::forward_iterator<Iterator_t>, std::forward_iterator_tag,
50 std::conditional_t<std::input_iterator<Iterator_t>,
51 std::input_iterator_tag, void>>>>>;
52
53/// True if the iterator is declared to meet LegacyInputIterator requirements.
54///
55/// Note that this does not check the requirements (not even syntactic ones): an
56/// iterator that lies about its category will fool this function. However, an
57/// iterator defined using Iterator_interface is guaranteed to satisfy the
58/// syntactic requirements.
59template <class Test>
61 std::derived_from<typename std::iterator_traits<Test>::iterator_category,
62 std::input_iterator_tag>;
63
64/// True if the iterator is declared to meet LegacyForwardIterator requirements.
65///
66/// Note that this does not check the requirements (not even syntactic ones): an
67/// iterator that lies about its category will fool this function. However, an
68/// iterator defined using Iterator_interface is guaranteed to satisfy the
69/// syntactic requirements.
70template <class Test>
72 std::derived_from<typename std::iterator_traits<Test>::iterator_category,
73 std::forward_iterator_tag>;
74
75/// True if the iterator is declared to meet LegacyBidirectionalIterator
76/// requirements.
77///
78/// Note that this does not check the requirements (not even syntactic ones): an
79/// iterator that lies about its category will fool this function. However, an
80/// iterator defined using Iterator_interface is guaranteed to satisfy the
81/// syntactic requirements.
82template <class Test>
84 std::derived_from<typename std::iterator_traits<Test>::iterator_category,
85 std::bidirectional_iterator_tag>;
86
87/// True if the iterator is declared to meet LegacyRandomAccessIterator
88/// requirements.
89///
90/// Note that this does not check the requirements (not even syntactic ones): an
91/// iterator that lies about its category will fool this function. However, an
92/// iterator defined using Iterator_interface is guaranteed to satisfy the
93/// syntactic requirements.
94template <class Test>
96 std::derived_from<typename std::iterator_traits<Test>::iterator_category,
97 std::random_access_iterator_tag>;
98
99} // namespace mysql::iterators
100
101// addtogroup GroupLibsMysqlIterators
102/// @}
103
104#endif // ifndef MYSQL_ITERATORS_META_H
True if the iterator is declared to meet LegacyBidirectionalIterator requirements.
Definition: meta.h:83
True if the iterator is declared to meet LegacyForwardIterator requirements.
Definition: meta.h:71
True if the iterator is declared to meet LegacyInputIterator requirements.
Definition: meta.h:60
True if the iterator is declared to meet LegacyRandomAccessIterator requirements.
Definition: meta.h:95
Definition: empty_sequence_iterator.h:37
std::conditional_t< std::contiguous_iterator< Iterator_t >, std::contiguous_iterator_tag, std::conditional_t< std::random_access_iterator< Iterator_t >, std::random_access_iterator_tag, std::conditional_t< std::bidirectional_iterator< Iterator_t >, std::bidirectional_iterator_tag, std::conditional_t< std::forward_iterator< Iterator_t >, std::forward_iterator_tag, std::conditional_t< std::input_iterator< Iterator_t >, std::input_iterator_tag, void > > > > > Iterator_concept_tag
Definition: meta.h:51