
Hello, Is it possible to initialize a flyweight lazy or better on user request? I have the problem that I have a custom allocator that is not ready to run before main. Currently, the flyweight initialization is performed on init of the fleiweight_core static_initilaizer member. This scheme does outrule the usage of the flyweight utility in my application. Any help would be appreciated. Best, Johannes ____________ Virus checked by G DATA AntiVirusKit Version: AVF 19.736 from 21.02.2010 Virus news: www.antiviruslab.com

Johannes Brunen escribió:
Hello,
Is it possible to initialize a flyweight lazy or better on user request? I have the problem that I have a custom allocator that is not ready to run before main. Currently, the flyweight initialization is performed on init of the fleiweight_core static_initilaizer member. This scheme does outrule the usage of the flyweight utility in my application.
Any help would be appreciated.
Hi Johannes,
You can write a custom lazy factory, just as the example attached.
Hope this helps,
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo cid:part1.03080702.04040303@tid.es
#include
struct lazy_factory:public boost::flyweights::factory_marker
{
template
fw_string;
int main() { fw_string str("boost"); }
participants (2)
-
joaquin@tid.es
-
Johannes Brunen