R
Ralf Goertz
Hi,
I have a large number of objects A (about 50 Million):
struct A {
set<string> s;
};
The set A::s contains a rather small number of strings (about 100 on
average). The number of elements in the superset of all A::s is about as
large as the number of A's. In order to save space I use
set<string> superset;
and
struct A {
set< set<string>::iterator, IterComp> s;
};
However in order to do that I have to add a comparison function for
set<string>::iterator. I chose it to be *left < *right. Is there any
other way to do that? Especially, if the iterators were pointers then
there should be an intrinsic order which I could use. Even if they are
not pointers can I somehow refer to the order the iterators have in the
superset without having to explicitely compare the strings?
Ralf
I have a large number of objects A (about 50 Million):
struct A {
set<string> s;
};
The set A::s contains a rather small number of strings (about 100 on
average). The number of elements in the superset of all A::s is about as
large as the number of A's. In order to save space I use
set<string> superset;
and
struct A {
set< set<string>::iterator, IterComp> s;
};
However in order to do that I have to add a comparison function for
set<string>::iterator. I chose it to be *left < *right. Is there any
other way to do that? Especially, if the iterators were pointers then
there should be an intrinsic order which I could use. Even if they are
not pointers can I somehow refer to the order the iterators have in the
superset without having to explicitely compare the strings?
Ralf