1//
2// Copyright (c) 2023-2023 Alexander Grund
3//
4// Distributed under the Boost Software License, Version 1.0.
5// https://www.boost.org/LICENSE_1_0.txt
6
7#ifndef BOOST_LOCALE_UTIL_FOREACH_CHAR_HPP
8#define BOOST_LOCALE_UTIL_FOREACH_CHAR_HPP
9
10#include <boost/locale/config.hpp>
11
12#ifndef BOOST_LOCALE_NO_CXX20_STRING8
13# define BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F) F(char8_t)
14# define BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F) F(char8_t)
15#elif defined(__cpp_char8_t)
16# define BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F) F(char8_t)
17# define BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F)
18#else
19# define BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F)
20# define BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F)
21#endif
22#ifdef BOOST_LOCALE_ENABLE_CHAR16_T
23# define BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F) F(char16_t)
24#else
25# define BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F)
26#endif
27#ifdef BOOST_LOCALE_ENABLE_CHAR32_T
28# define BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F) F(char32_t)
29#else
30# define BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F)
31#endif
32
33#define BOOST_LOCALE_FOREACH_CHAR(F) \
34 F(char) \
35 F(wchar_t) \
36 BOOST_LOCALE_FOREACH_CHAR_I_CHAR8_T(F) \
37 BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F) \
38 BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F)
39
40// Same but only where std::basic_string<C> is available
41#define BOOST_LOCALE_FOREACH_CHAR_STRING(F) \
42 F(char) \
43 F(wchar_t) \
44 BOOST_LOCALE_FOREACH_CHAR_I2_CHAR8_T(F) \
45 BOOST_LOCALE_FOREACH_CHAR_I_CHAR16_T(F) \
46 BOOST_LOCALE_FOREACH_CHAR_I_CHAR32_T(F)
47
48#endif
49

source code of boost/libs/locale/src/boost/locale/util/foreach_char.hpp