Q:

C++ container for compound index that allows ignoring sub-index at look-up

What is an appropriate container for compound index that allows ignoring the sub-index at lookup?  It should not use more resources than a container without this feature. 
F.e.  given the index
struct index_t
{
    index_t(unsigned key_, unsigned subkey_)
        :   key(key_)
        ,   subkey(subkey_)
    {}
    unsigned key;
    unsigned subkey;
};

and inserting
index_t(1,11)
index_t(2,21)
index_t(2,22)
index_t(2,23)
index_t(3,31)

all the elements with f.e.  key == 2 and ignoring the subkey have to be looked up. 
Also lookups with given key and subkey must be possible.  So using a multiset/map with key as the only container's key is not a solution. 

A:

You could do 
std::set<index_t>  mySet;

And for searching for all items with a given key and any subkey, do
std::pair<std::set<index_t>::iterator, std::set<index_t>::iterator> range;
range.first = mySet.lower_bound(index_t(key, 0));
range.second = mySet.upper_bound(index_t(key, UINT_MAX));

That'll preserve 2*log n performance.