⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rb_tree_functors.h

📁 最新的版本ACE-5.6.8,刚从外文网上搬下,与大家分享.
💻 H
字号:
/* -*- C++ -*- */
// $Id: RB_Tree_Functors.h 80826 2008-03-04 14:51:23Z wotte $

#ifndef __RB_TREE_FUNCTORS_H_
#define __RB_TREE_FUNCTORS_H_

#include "ace/Functor.h"

// Listing 1 code/ch05
// Same key type.
class KeyType
{
public:
  KeyType () : val_(0) {}
  KeyType (int i) : val_ (i) {}
  KeyType (const KeyType& kt) { this->val_ = kt.val_; }
  operator int() const { return val_; };

private:
  int val_;
};

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

template<>
class ACE_Less_Than<KeyType>
{
public:
  int operator() (const KeyType k1, const KeyType k2)
  { return k1 < k2; }
};

ACE_END_VERSIONED_NAMESPACE_DECL

// Listing 1

#endif /* __RB_TREE_FUNCTORS_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -