
AMDG On 2/6/2011 8:13 AM, Lorenzo Caminiti wrote:
On Sun, Feb 6, 2011 at 10:56 AM, Mathias Gaunard <mathias.gaunard@ens-lyon.org> wrote:
On 05/02/2011 22:04, Lorenzo Caminiti wrote:
Sorry, C++ preprocessor only -- that was a requirement for me... (Can you imagine how much the syntax can be simplified with varidiac macros... I can!! Too bad I can't use them...).
Can you give me one modern C++ compiler that doesn't support variadic macros?
Mathias: No, I can't. Variadic macros are not certified on the compiler I use so *I personally* cannot use them even if they are there (I am really using a gcc C99 preprocessor). *I personally* can only use the C++ standard features, I am not sure about others... As I said, I will take a look to what variadic macros and Alex-Steven syntax can do for Boost.Local.
FWIW, we didn't use variadic macros to implement it. To achieve this, the actual expansion of the macros is rather weird. BOOST_LOCAL_FUNCTION is an object-like macro and the parameter list is the parameter list of the implementation function (it isn't processed by any macros at all). BOOST_BIND closes the local class created by BOOST_LOCAL_FUNCTION and starts a new one. In Christ, Steven Watanabe