CASM  1.1.0
A Clusters Approach to Statistical Mechanics
unique_cloneable_map.hh
Go to the documentation of this file.
1 #ifndef CASM_unique_cloneable_map_HH
2 #define CASM_unique_cloneable_map_HH
3 
6 
7 namespace notstd {
8 
9 template <typename MapType>
11  typedef typename MapType::iterator::reference reference;
12  typedef typename MapType::iterator::value_type::second_type::reference
14 
16 
17  result_type operator()(reference pair) const { return *(pair.second); }
18 };
19 
20 template <typename MapType>
22  typedef typename MapType::const_iterator::reference reference;
23  typedef const typename MapType::const_iterator::value_type::second_type::
24  reference result_type;
25 
27 
28  result_type operator()(reference pair) const { return *(pair.second); }
29 };
30 
33 template <typename KeyType, typename ValueType,
34  typename MapType = std::map<KeyType, cloneable_ptr<ValueType> > >
38 
39 } // namespace notstd
40 
41 #endif
std::map wrapper to enforce a 1-1 ValueType->KeyType relationship
Definition: unique_map.hh:124
Non-std smart pointer classes and functions.
MapType::const_iterator::reference reference
const MapType::const_iterator::value_type::second_type::reference result_type
result_type operator()(reference pair) const
result_type operator()(reference pair) const
MapType::iterator::reference reference
MapType::iterator::value_type::second_type::reference result_type