66 template<
class Key,
class T>
70 typedef T mapped_type;
71 typedef std::pair<Key,T> value_type;
72 typedef std::list<value_type> list_t;
73 typedef typename list_t::iterator iterator;
74 typedef typename list_t::const_iterator const_iterator;
83 std::map(
const std::map<Key,T>& map_in ) : list_( map_in.list_ ) {}
86 virtual ~
std::map() {}
93 iterator begin() {
return list_.begin(); }
96 const_iterator begin()
const {
return list_.begin(); }
99 iterator end() {
return list_.end(); }
102 const_iterator end()
const {
return list_.end(); }
109 mapped_type& operator[](
const key_type& k )
111 iterator itr = find(k);
112 if(itr != end())
return (*itr).second;
113 list_.push_back( value_type( k, T() ) );
114 return list_.back().second;
126 iterator find(
const key_type& k)
128 for( iterator itr = begin(); itr != end(); ++itr ) {
129 if( (*itr).first == k ) {
141 const_iterator find(
const key_type& k)
const 143 for( const_iterator itr = begin(); itr != end(); ++itr ) {
144 if( (*itr).first == k ) {
151 bool empty()
const {
return list_.empty(); }
166 #endif // TEUCHOS_MAP_H Teuchos header file which uses auto-configuration information to include necessary C++ headers...