From: Mathias Gaunard on 7 Feb 2010 16:09 On 4 f�v, 21:34, muggar <gall.c...(a)gmail.com> wrote: > Hi, > how to implement compile time hook mechanism? An use case would look > like: > > AClass<SomeType,Hooks<FunctorOne,FunctorTwo,...>> aobj; > > AClass::AFunction() { > // ... > RunHooks(); > // ... > > } So basically your "hooks" is a compile-time list of function objects. Look at Boost.MPL for a way to represent those lists and iterate them (you'll want boost::mpl::for_each) -- [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]
|
Pages: 1 Prev: vector:erase iterator requirements Next: C++ and shared objects |