|
From: Bastiaan B. <Bas...@li...> - 2002-06-25 08:33:57
|
Hmm, that sucks. Any chance of MS fixing this problem soon? Being limited to only use std::vector in your APIs is ridiculous. However currrently only getCurrentCategories() is affected. It uses std::set now, but changing that to std::vector wouldn't hurt very much, and may be more efficient as std::vector is the simplest container in most STL implementations. Yes, it's an incompatible API change, but 0.3.x is a development branch anyway. Regards, Bastiaan PS. The above is not a commitment to keep the log4cpp API MSVC DLL export clean. On Sun, 2002-06-23 at 10:08, David Resnick wrote: > I found this out when trying to use Category::getCurrentCategories(), > which returns std::set<Category*>*. The set I got had 1 good pointer; > the rest were invalid. > > The problem is detailed by MS in Q168958 "HOWTO: Exporting STL > Components Inside & Outside of a Class". Here is the key paragraph: > > "Some STL classes contain nested classes. These classes can not be > exported. For instance, deque contains a nested class deque::iterator. > If you export deque, you will get a warning that you must export > deque::iterator. If you export deque::iterator, you get a warning that > you must export deque. This is caused by a designed limitation that once > a template class is instantiated, it can not be re-instantiated and > exported. The only STL container that can currently be exported is > vector. The other containers (that is, map, set, queue, list, deque) all > contain nested classes and cannot be exported." > > So if you want to use methods such as Category::getCurrentCategories(), > do them in a helper class that is linked as part of the DLL. I added > what I needed to the SimpleConfigurator (what I needed to do was delete > previously defined appenders from all categories before reloading a > config file, so it made sense in any case to put it there.) > > Regards, > > David Resnick > MobileSpear Inc. > > > > ------------------------------------------------------- > Sponsored by: > ThinkGeek at http://www.ThinkGeek.com/ > _______________________________________________ > Log4cpp-devel mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4cpp-devel |