Rosetta Utilities  2014.35
Classes | Namespaces | Functions
KeyVector.hh File Reference

Keyed-access vector. More...

#include <utility/keys/KeyVector.fwd.hh>
#include <utility/vector1.hh>
#include <algorithm>
#include <cassert>

Classes

class  utility::keys::KeyVector< K, T >
 Keyed-access vector. More...
 

Namespaces

 utility
 unresizable vector whose size is known at compile time, which may be allocated on the stack, and which indexes from 1.
 
 utility::keys
 

Functions

template<typename K , typename T >
void utility::keys::swap (KeyVector< K, T > &a, KeyVector< K, T > &b)
 swap( KeyVector, KeyVector ) More...
 
template<typename K , typename T >
bool utility::keys::operator== (KeyVector< K, T > const &a, KeyVector< K, T > const &b)
 KeyVector == KeyVector. More...
 
template<typename K , typename T >
bool utility::keys::operator!= (KeyVector< K, T > const &a, KeyVector< K, T > const &b)
 KeyVector != KeyVector. More...
 
template<typename K , typename T >
void std::swap (utility::keys::KeyVector< K, T > &a, utility::keys::KeyVector< K, T > &b)
 swap( KeyVector, KeyVector ) More...
 

Detailed Description

Keyed-access vector.

Author
Stuart G. Mentzer (Stuar.nosp@m.t_Me.nosp@m.ntzer.nosp@m.@obj.nosp@m.exx.c.nosp@m.om)
Note
  • Vector for a full set of active keys: For key subsets use SmallKeyVector
  • Similar to using vector1< T > with some extra syntax for automatic growth
  • Key can be any type that is convertible to the vector's index type
  • If a utility Key subtype is used it must declare the KeyVector as a friend
  • Keys are added by assign(), operator(), and add()
  • Keys can be added out of order: holes are default constructed values