Main Page
Class Categories
Classes
Namespaces
File List
File Members
exper-sw
cosmosw
AugerSW
Offline
source
main
Utilities
STL
testBoolCastAdd.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
Err1
{
22
public
:
23
operator
bool()
const
{
return
true
; }
24
25
int
fI
;
26
};
27
28
29
int
30
main
()
31
{
32
C1
o1;
33
C1
o2;
34
35
Err1
oe1;
36
Err1
oe2;
37
38
// this compiles
39
int
i = oe1 + oe2;
40
41
// this fails
42
const
int
j = o1 + o2;
43
44
// to avoid additional warnings
45
i = j;
46
47
return
0;
48
}
Err1
Definition:
testBoolCastAdd.cc:21
C1::BoolCast
bool BoolCast() const
Definition:
testBoolCastAdd.cc:15
Err1::fI
int fI
Definition:
testBoolCastAdd.cc:25
main
int main(int argc, char *argv[])
Definition:
DBSync.cc:58
C1::fI
int fI
Definition:
testBoolCastAdd.cc:17
C1
Definition:
testBoolCastAdd.cc:13
, generated on Tue Sep 26 2023.