MySQL 9.6.0
Source Code Documentation
is_same_as_all.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_META_IS_SAME_AS_ALL_H
25#define MYSQL_META_IS_SAME_AS_ALL_H
26
27/// @file
28/// Experimental API header
29
30#include <type_traits>
31
32/// @addtogroup GroupLibsMysqlMeta
33/// @{
34
36
37/// Helper to implement Is_same_as_all. This is the primary template.
38template <class... Types>
39struct All_same_helper : std::false_type {};
40
41/// Helper to implement Is_same_as_all. This is the specialization to zero
42/// arguments.
43template <>
44struct All_same_helper<> : std::true_type {};
45
46/// Helper to implement Is_same_as_all. This is the specialization to one
47/// argument.
48template <class Type>
49struct All_same_helper<Type> : std::true_type {};
50
51/// Helper to implement Is_same_as_all. This is the recursive step with two or
52/// more arguments.
53template <class First, class... Rest>
54struct All_same_helper<First, First, Rest...>
55 : All_same_helper<First, Rest...> {};
56
57} // namespace mysql::meta::detail
58
59namespace mysql::meta {
60
61/// True if all the given types are equal (like a vararg version of
62/// std::same_as).
63template <class... Types>
64concept Is_same_as_all = detail::All_same_helper<Types...>::value;
65
66} // namespace mysql::meta
67
68// addtogroup GroupLibsMysqlMeta
69/// @}
70
71#endif // ifndef MYSQL_META_IS_SAME_AS_ALL_H
True if all the given types are equal (like a vararg version of std::same_as).
Definition: is_same_as_all.h:64
MediaType
Definition: media_type.h:33
ValueType value(const std::optional< ValueType > &v)
Definition: gtid.h:83
Definition: is_same_as_all.h:35
Definition: is_charlike.h:36
Helper to implement Is_same_as_all. This is the primary template.
Definition: is_same_as_all.h:39