From: Roy S. <roy...@ic...> - 2009-11-19 04:45:39
|
On Wed, 18 Nov 2009, John Peterson wrote: > On Wed, Nov 18, 2009 at 9:26 PM, Liu Kai <liu...@gm...> wrote: >> Hi all, >> >> I find that things like string_to_enum and enum_to_string in src/utils >> are exactly bi-direction map, which has been well implemented in boost >> library. So why not use the boost::bimap to implement these >> functionality, instead of implement the same thing by hand? >> >> I just want to know if the reason is boost::bimap has some potential >> problems, or is it a historical reason? > > We don't use boost at all in the library. There are probably > thousands of places where we could and should. Note also that boost::bimap postdates string_to_enum/enum_to_string by a year or two. Looks like Ben's options in 2005 were using codeproject::bimap, or building his own bimap on top of boost::multi_index_container... I'm not trying to advocate a total Not-Invented-Here attitude, but tracking APIs that might be still in flux is a pain. That's worthwhile for something like PETSc; not so much for a single little lookup table. Of course, that was 2005; this is 2009. It looks like the Boost folks have been happy with the bimap interface for a couple years now, and they generally do very good work. --- Roy |