Util--  1.1
uniq_pointer.hh
Go to the documentation of this file.
1 /* -*- C++ -*-
2  * $Id: uniq_pointer.hh 957 2005-03-07 16:01:20Z sjoyeux $
3  */
4 #ifndef UTILMM_SMART_UNIQ_POINTER_HEADER
5 # define UTILMM_SMART_UNIQ_POINTER_HEADER
6 #include "utilmm/config/config.h"
7 
10 #include "utilmm/smart/pointer.hh"
11 
12 namespace utilmm {
13  namespace smart {
14 
46  template< typename Ty, class Hash=hash<Ty>, class Equal=std::equal_to<Ty> >
47  struct uniq_pointer {
48  private:
51 
52  public:
59  }; // struct utilmm::smart::uniq_pointer
60 
61  }; // namespace utilmm::smart
62 
63  template<class Manager>
64  struct hash< smart::pointer<Manager> >
65  :public std::unary_function<smart::pointer<Manager>, size_t> {
66  size_t operator()(smart::pointer<Manager> const &x) const {
68 
69  return size_t(x.null()?0:hf(x));
70  }
71  }; // struc utilmm::hash< smart::pointer<> >
72 
73 } // namespace utilmm
74 
75 #endif // UTILMM_SMART_UNIQ_POINTER_HEADER
76 
hash functor
Definition: hash.hh:30
Definition of utilmm::smart::pointer.
Defintion of utilmm::smart::ref_count::uniq_memory.
Reference counting management.
Definition: ref_count_manager.hh:35
Unique instance memory manager.
Definition: uniq_memory.hh:97
bool null() const
Check if null.
Generic smart pointer.
Definition: pointer.hh:52
Definition: auto_flag.hh:6
Definition of utilmm::smart::ref_count::manager.
size_t operator()(smart::pointer< Manager > const &x) const
Definition: uniq_pointer.hh:66
pointer< manager_type > type
The smart pointer type.
Definition: uniq_pointer.hh:58
Unique instance memory pointer definition traits.
Definition: uniq_pointer.hh:47

Generated on Mon Sep 24 2018 17:06:40 for Util-- by doxygen 1.8.13
SourceForge.net Project Page