Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / ACE / examples / APG / Containers / RB_Tree_Functors.h
blob336342ac787363c83c362ecccdc63f3716fdb61f
1 /* -*- C++ -*- */
2 #ifndef __RB_TREE_FUNCTORS_H_
3 #define __RB_TREE_FUNCTORS_H_
5 #include "ace/Functor.h"
7 // Listing 1 code/ch05
8 // Same key type.
9 class KeyType
11 public:
12 KeyType () : val_(0) {}
13 KeyType (int i) : val_ (i) {}
14 KeyType (const KeyType& kt) { this->val_ = kt.val_; }
15 operator int() const { return val_; };
17 private:
18 int val_;
21 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
23 template<>
24 class ACE_Less_Than<KeyType>
26 public:
27 int operator() (const KeyType k1, const KeyType k2)
28 { return k1 < k2; }
31 ACE_END_VERSIONED_NAMESPACE_DECL
33 // Listing 1
35 #endif /* __RB_TREE_FUNCTORS_H_ */