MySQL 9.6.0
Source Code Documentation
set_categories.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_SETS_SET_CATEGORIES_H
25#define MYSQL_SETS_SET_CATEGORIES_H
26
27/// @file
28/// Experimental API header
29
30#include <concepts> // derived_from
31#include "mysql/meta/optional_is_same.h" // Optional_is_same
32
33/// @addtogroup GroupLibsMysqlSets
34/// @{
35
36namespace mysql::sets {
37
38/// Base class for all Set category tag classes.
39///
40/// Set categories are used to tag-dispatch to the correct algorithms when
41/// computing operations on sets, such as unions and other set operations;
42/// membership tests and other Boolean set predicates; string conversion; etc.
44
45/// True if Test is a Set category tag, i.e., derived from
46/// Base_set_category_tag.
47template <class Test>
48concept Is_set_category = std::derived_from<Test, Base_set_category_tag>;
49
50/// True if Test has a member Set_category_t satisfying Is_set_category.
51///
52/// If the template argument Set_category_t is given, true only if
53/// Test::Set_category_t is the same type as Set_category_t.
54template <class Test, class Set_category_t = void>
57 mysql::meta::Optional_is_same<typename Test::Set_category_t,
58 Set_category_t>;
59
60/// True if the two Set classes have the same Set_category_t.
61template <class Test1, class Test2>
64 std::same_as<typename Test1::Set_category_t,
65 typename Test2::Set_category_t>;
66
67// ==== Specific kinds of set categories ====
68
69/// Primary variable template for customization point that declares that a set
70/// category is iterator-defined. See Is_iterator_defined_set for details.
71///
72/// To declare that a set category T is iterator-defined, specialize this like:
73///
74/// @code
75/// template <>
76/// inline constexpr bool is_iterator_defined_set_category<T> = true;
77/// @endcode
78template <Is_set_category>
79inline constexpr bool is_iterator_defined_set_category = false;
80
81} // namespace mysql::sets
82
83// addtogroup GroupLibsMysqlSets
84/// @}
85
86#endif // ifndef MYSQL_SETS_SET_CATEGORIES_H
True if either Other is omitted/void, or Test is the same type as Other.
Definition: optional_is_same.h:39
True if the two Set classes have the same Set_category_t.
Definition: set_categories.h:62
True if Test has a member Set_category_t satisfying Is_set_category.
Definition: set_categories.h:55
True if Test is a Set category tag, i.e., derived from Base_set_category_tag.
Definition: set_categories.h:48
Definition: gtid_set.h:183
constexpr bool is_iterator_defined_set_category
Primary variable template for customization point that declares that a set category is iterator-defin...
Definition: set_categories.h:79
Experimental API header.
Base class for all Set category tag classes.
Definition: set_categories.h:43