Main Page
Class Categories
Classes
Namespaces
File List
File Members
exper-sw
cosmosw
AugerSW
Offline
source
main
Utilities
STL
testBoolCastCompareDifferentType.cc
Go to the documentation of this file.
1
8
#include <utl/SafeBoolCast.h>
9
10
using namespace
utl;
11
12
13
class
C1
:
public
SafeBoolCast<C1> {
14
public
:
15
bool
BoolCast
()
const
{
return
true
; }
16
17
int
fI;
18
};
19
20
21
class
C2
:
public
SafeBoolCast<C2> {
22
public
:
23
bool
BoolCast
()
const
{
return
false
; }
24
25
double
fD
;
26
};
27
28
29
class
Err1
{
30
public
:
31
operator
bool()
const
{
return
true
; }
32
33
int
fI;
34
};
35
36
37
class
Err2
{
38
public
:
39
operator
bool()
const
{
return
true
; }
40
41
int
fI
;
42
};
43
44
45
int
46
main
()
47
{
48
C1
o1;
49
C2
o2;
50
51
Err1
oe1;
52
Err2
oe2;
53
54
// this compiles
55
bool
b
= (oe1 == oe2);
56
57
// this fails
58
const
int
bb = (o1 == o2);
59
60
// to avoid additional warnings
61
b = bb;
62
63
return
0;
64
}
Err1
Definition:
testBoolCastAdd.cc:21
C1::BoolCast
bool BoolCast() const
Definition:
testBoolCastCompareDifferentType.cc:15
C2::BoolCast
bool BoolCast() const
Definition:
testBoolCastCompareDifferentType.cc:23
RdGeoCeLDFFitter::b
const double b[]
Definition:
RdGeoCeLDFFitter/LikelihoodFunction.cc:539
Err2::fI
int fI
Definition:
testBoolCastCompareDifferentType.cc:41
main
int main(int argc, char *argv[])
Definition:
DBSync.cc:58
C2::fD
double fD
Definition:
testBoolCastCompareDifferentType.cc:25
C2
Definition:
testBoolCastCompareDifferentType.cc:21
Err2
Definition:
testBoolCastCompareDifferentType.cc:37
C1
Definition:
testBoolCastAdd.cc:13
, generated on Tue Sep 26 2023.