69 template<
class Key,
class T>
73 typedef T mapped_type;
74 typedef std::pair<Key,T> value_type;
75 typedef std::list<value_type> list_t;
76 typedef typename list_t::iterator iterator;
77 typedef typename list_t::const_iterator const_iterator;
86 std::map(
const std::map<Key,T>& map_in ) : list_( map_in.list_ ) {}
89 virtual ~std::map() {}
96 iterator begin() {
return list_.begin(); }
99 const_iterator begin()
const {
return list_.begin(); }
102 iterator end() {
return list_.end(); }
105 const_iterator end()
const {
return list_.end(); }
112 mapped_type& operator[](
const key_type& k )
114 iterator itr = find(k);
115 if(itr != end())
return (*itr).second;
116 list_.push_back( value_type( k, T() ) );
117 return list_.back().second;
129 iterator find(
const key_type& k)
131 for( iterator itr = begin(); itr != end(); ++itr ) {
132 if( (*itr).first == k ) {
144 const_iterator find(
const key_type& k)
const
146 for( const_iterator itr = begin(); itr != end(); ++itr ) {
147 if( (*itr).first == k ) {
154 bool empty()
const {
return list_.empty(); }
169 #endif // TEUCHOS_MAP_H
Teuchos header file which uses auto-configuration information to include necessary C++ headers...