What do you like to use as work? Container objects or macros? Do you think it's worth it?
The canonical way is to use a metapound similar in this way:
template <typename T> struct my_string_map { typedef std::map<std::string, T> type; };
It is also used in STL ( allocator::rebind<U> ) and in many libraries, including Boost. We widely use it in the bioinformation library .
It is bloated, but it is the best alternative in 99% of cases. Using macros here is not worth the many flaws.
(EDIT: I amended the code to reflect Boost / STL agreements, as Daniel pointed out in his comment.)
Konrad Rudolph Aug 25 '08 at 14:51 2008-08-25 14:51
source share