ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
iterablebitset.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_enums of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALIB_ENUMS_ITERABLE_BITSET
9#define HPP_ALIB_ENUMS_ITERABLE_BITSET 1
10
11#if !defined (HPP_ALIB_ENUMS_ITERABLE)
13#endif
14
16
17#if !defined (HPP_ALIB_LANG_BITSET)
18# include "alib/lang/bitset.hpp"
19#endif
20
21namespace alib { namespace enums {
22#if defined(ALIB_DOX)
23/** ************************************************************************************************
24 * This is a using statement which is available (enabled) for enumerations for which traits struct
25 * \alib{enums;T_EnumIsIterable} is specialized. With this, the interface methods of templated
26 * class \alib{lang;TBitSet} accept and return enumeration elements.
27 *
28 * @see For a quick tutorial on the use of this type, see chapter
29 * \ref alib_enums_iter_bitset "3.5 Using Class TBitSet with Iterable Enums" of the Programmer's
30 * Manual of module \alib_enums_nl.
31 *
32 * @tparam TEnum The enum type to use with class \alib{lang;TBitSet}.
33 * \note Other than documented here, this using statement has a second template parameter
34 * \p{TEnableIf}. This parameter has a default expressions and <b>must not</b> be provided
35 * because it is used internally to ensure that only if a specialization of
36 * \alib{enums;T_EnumIsIterable;T_EnumIsIterable<TEnum>} exists, this type definition becomes
37 * available.
38 * (..and this is why it was explicitly 'faked out' of this documentation).
39 **************************************************************************************************/
40template<typename TEnum>
41using EnumBitSet = TBitSet<TEnum, enums::T_EnumIsIterable<TEnum>::End,
43#else
44template<typename TEnum, typename TEnableIf
48#endif
49} // namespace alib[::enums]
50
51#if defined(ALIB_DOX)
52
53/// Type alias in namespace \b alib.
54/// @see For more information, consult type definition \alib{enums;EnumBitSet}.
55template<typename TEnum>
58#else
59template<typename TEnum, typename TEnableIf
63#endif
64
65} // namespace [alib]
66
67#endif // HPP_ALIB_ENUMS_ITERABLE_BITSET
#define ALIB_ASSERT_MODULE(modulename)
Definition alib.hpp:190
#define ATMP_VOID_IF(Cond)
Definition tmp.hpp:52
#define ATMP_EQ( T, TEqual)
Definition tmp.hpp:32
TBitSet< TEnum, enums::T_EnumIsIterable< TEnum >::End, enums::T_EnumIsIterable< TEnum >::Begin > EnumBitSet
Definition alib.cpp:57