
Hi, thanks for the flyweight library, looks good. Is there a way to enumerate all values in a factory? Consider my use case: I have a large set of data. Each element has a user defined 'tag', implemented as a flyweight<std::string>. Now the user wants to find all elements where the 'tag' matches a regex. Calculating the regex match for all elements in the dataset is expensive. If I could find all matching tags in the flyweight factory first, searching the elements is reduced to comparing two flyweights rather than doing a regex match. Consider: struct data { flyweight<std::string> m_tag; }; vector<data> m_some_data; The straight forward approach is costly: for (iterator i=m_some_data.begin(); i!=m_some_data.end() && regex_match(*i); ++i) ; with the regex match calculated for every element in the vector. A much more efficient solution is to find all elements in the flyweight factory that match the regex and then compare the flyweights. vector<flyweight<std::string> > m_matching_tags=find_matching_flyweights(regex); Now iterating over the data needs to compare two flyweights per data element which should be a lot faster than doing a regex match. Is there a way? Regards Hajo