testBoolCastNonVirtualDerived.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 private:
17  int fI;
18 };
19 
20 
21 class C2: public SafeBoolCast<C2>, public C1 {
22 private:
23  bool BoolCast() const { return false; }
24 
25  double fD;
26 };
27 
28 
29 int
31 {
32  C2 o2;
33 
34  const bool b(o2);
35 
36  //avoid extra compiler warnings
37  bool b2;
38  b2 = b;
39 
40  return 0;
41 }
bool BoolCast() const
bool BoolCast() const
int main(int argc, char *argv[])
Definition: DBSync.cc:58

, generated on Tue Sep 26 2023.