From: Mathias Gaunard on
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! ]