Lumiera
0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
maybe-compare.hpp
Go to the documentation of this file.
1
/*
2
MAYBE-COMPARE.hpp - guarded invocation of comparisons
3
4
Copyright (C)
5
2009, Hermann Vosseler <Ichthyostega@web.de>
6
7
**Lumiera** is free software; you can redistribute it and/or modify it
8
under the terms of the GNU General Public License as published by the
9
Free Software Foundation; either version 2 of the License, or (at your
10
option) any later version. See the file COPYING for further details.
11
12
*/
13
14
20
#ifndef LIB_META_MAYBE_COMPARE_H
21
#define LIB_META_MAYBE_COMPARE_H
22
23
24
25
26
namespace
lib
{
27
namespace
meta{
28
29
34
template
<
typename
X>
35
struct
Comparator
36
{
37
static
bool
38
equals
(X
const
&
x1
, X
const
&
x2
)
39
{
40
return
x1
==
x2
;
41
}
42
};
43
44
/* == add specialisations here == */
45
46
47
template
<
typename
X>
48
inline
bool
49
equals_safeInvoke
(X
const
&
x1
, X
const
&
x2
)
50
{
51
return
Comparator<X>::equals
(
x1
,
x2
);
52
}
53
54
55
}}
// namespace lib::meta
56
#endif
lib::meta::enable_if
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition
meta/util.hpp:87
lib::meta::equals_safeInvoke
bool equals_safeInvoke(X const &x1, X const &x2)
Definition
maybe-compare.hpp:49
lib
Implementation namespace for support and library code.
Definition
common-services.cpp:55
lib::meta::Comparator
Trait template for invoking equality comparison.
Definition
maybe-compare.hpp:36
lib::meta::Comparator::equals
static bool equals(X const &x1, X const &x2)
Definition
maybe-compare.hpp:38
lib
meta
maybe-compare.hpp
Generated on Fri Nov 7 2025 for Lumiera by
1.9.8