ALib C++ Framework
by
Library Version: 2605 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
boxing/stdfunctors.hpp
Go to the documentation of this file.
1//==================================================================================================
2/// \file
3/// This header-file is part of the \aliblong.
4///
5/// Copyright 2013-2026 A-Worx GmbH, Germany.
6/// Published under #"mainpage_license".
7//==================================================================================================
8#if DOXYGEN
10#else
11ALIB_EXPORT namespace std {
12#endif
13
14//==================================================================================================
15/// Specialization of functor <c>std::hash</c> for type #"Box".
16///
17/// This specialization is provided with the inclusion of header-file
18/// #"F;ALib.Boxing.StdFunctors.H".<br>
19/// While the documentation indicates namespace <c>alib::compatibility::std</c>, the
20/// specialization is (as needed) implemented in namespace <c>std</c>.
21//==================================================================================================
22template<> struct hash<alib::boxing::Box> {
23 /// Invokes and returns the result of box-function #"FHashcode".
24 /// @param src The box object to hash.
25 /// @return The hash code.
26 size_t operator()(const alib::boxing::Box& src) const { return src.Hashcode(); }
27};
28
29//==================================================================================================
30/// Specialization of functor <c>std::equal_to</c> for type #"Box".
31///
32/// This specialization is provided with the inclusion of header-file
33/// #"F;ALib.Boxing.StdFunctors.H".<br>
34/// While the documentation indicates namespace <c>alib::compatibility::std</c>, the
35/// specialization is (as needed) implemented in namespace <c>std</c>.
36//==================================================================================================
37template<> struct equal_to<alib::boxing::Box> {
38 /// Invokes #"Box::operator==" passing \p{lhs} and \p{rhs}.
39 /// @param lhs The left-hand side box.
40 /// @param rhs The right-hand side box.
41 /// @return The result of the comparison.
43 const alib::boxing::Box& rhs ) const { return lhs.operator==( rhs ); }
44
45};
46
47//==================================================================================================
48/// Specialization of functor <c>std::less</c> for type #"Box".
49///
50/// For the comparison, box-function #"FIsLess" is invoked on \p{lhs} with passing
51/// \p{rhs}.
52///
53/// This specialization is provided with the inclusion of header-file
54/// #"F;ALib.Boxing.StdFunctors.H".<br>
55/// While the documentation indicates namespace <c>alib::compatibility::std</c>, the
56/// specialization is (as needed) implemented in namespace <c>std</c>.
57//==================================================================================================
58template<> struct less<alib::boxing::Box> {
59 /// Invokes box-function #"FIsLess" on \p{lhs} and returns the result.
60 /// @param lhs The left-hand side box.
61 /// @param rhs The right-hand side box.
62 /// @return The result of the comparison.
64 const alib::boxing::Box& rhs) const { return lhs.operator<( rhs ); }
65
66};
67
68//==================================================================================================
69/// Specialization of functor <c>std::hash</c> for type #"boxing::Enum".
70///
71/// This specialization is provided with the inclusion of header-file
72/// #"F;ALib.Boxing.StdFunctors.H".<br>
73/// While the documentation indicates namespace <c>alib::compatibility::std</c>, the
74/// specialization is (as needed) implemented in namespace <c>std</c>.
75//==================================================================================================
76template<> struct hash<alib::boxing::Enum> {
77 /// Calculates the hash code for class #"%Enum".
78 /// @param src The #"%Enum" object to hash.
79 /// @return The hash code.
80 size_t operator()(const alib::boxing::Enum& src) const { return src.Hashcode(); }
81};
82
83//==================================================================================================
84/// Specialization of functor <c>std::equal_to</c> for type #"boxing::Enum".
85///
86/// This specialization is provided with the inclusion of header-file
87/// #"F;ALib.Boxing.StdFunctors.H".<br>
88/// While the documentation indicates namespace <c>alib::compatibility::std</c>, the
89/// specialization is (as needed) implemented in namespace <c>std</c>.
90//==================================================================================================
91template<> struct equal_to<alib::boxing::Enum> {
92 /// Invokes #"Enum::operator==(const)" on \p{lhs} and \p{rhs}.
93 /// @param lhs The left-hand side #"%Enum".
94 /// @param rhs The right-hand side #"%Enum".
95 /// @return The result of the comparison.
97 const alib::boxing::Enum rhs) const { return lhs == rhs; }
98};
99
100//==================================================================================================
101/// Specialization of functor <c>std::less</c> for type #"boxing::Enum".
102///
103/// This specialization is provided with the inclusion of header-file
104/// #"F;ALib.Boxing.StdFunctors.H".<br>
105/// While the documentation indicates namespace <c>alib::compatibility::std</c>, the
106/// specialization is (as needed) implemented in namespace <c>std</c>.
107//==================================================================================================
108template<> struct less<alib::boxing::Enum> {
109 /// Invokes box-function #"FIsLess" on \p{lhs} and returns the result.
110 /// @param lhs The left-hand side #"%Enum".
111 /// @param rhs The right-hand side #"%Enum".
112 /// @return The result of the comparison.
114 const alib::boxing::Enum& rhs) const { return lhs < rhs; }
115
116};
117
118} // namespace [std]
#define ALIB_EXPORT
size_t Hashcode() const
Definition alox.cpp:14
size_t Hashcode() const
bool operator()(const alib::boxing::Box &lhs, const alib::boxing::Box &rhs) const
bool operator()(const alib::boxing::Enum lhs, const alib::boxing::Enum rhs) const
size_t operator()(const alib::boxing::Box &src) const
size_t operator()(const alib::boxing::Enum &src) const
bool operator()(const alib::boxing::Box &lhs, const alib::boxing::Box &rhs) const
bool operator()(const alib::boxing::Enum &lhs, const alib::boxing::Enum &rhs) const