|
Go to the documentation of this file. 1 #ifndef NPSTAT_CONSTSUBSCRIPTMAP_HH_
2 #define NPSTAT_CONSTSUBSCRIPTMAP_HH_
18 template < class Key, class T,
19 class Compare = std::less<Key>,
20 class Allocator = std::allocator<std::pair<const Key,T> > >
23 inline T& operator[]( const Key&);
24 inline const T& operator[]( const Key&) const;
27 template< class Key, class T, class Compare, class Allocator>
31 if (it == std::map<Key,T,Compare,Allocator>::end()) throw std::invalid_argument(
32 "In npstat::ConstSubscriptMap::operator[]: key not found");
33 return const_cast<T& >(it->second);
36 template< class Key, class T, class Compare, class Allocator>
37 inline const T& ConstSubscriptMap<Key,T,Compare,Allocator>::operator[]( const Key& key) const
39 typename ConstSubscriptMap<Key,T,Compare,Allocator>::const_iterator it = this->find(key);
40 if (it == std::map<Key,T,Compare,Allocator>::end()) throw std::invalid_argument(
41 "In npstat::ConstSubscriptMap::operator[]: key not found");
Definition: AbsArrayProjector.hh:14
Definition: ConstSubscriptMap.hh:22
|