
On Sun, Feb 6, 2011 at 7:20 AM, Alexander Nasonov <alnsn@yandex.ru> wrote:
Lorenzo Caminiti wrote:
On Fri, Feb 4, 2011 at 3:43 PM, Kenny Riddile <kfriddile@gmail.com> wrote:
On 2/4/2011 3:39 PM, Phil Endecott wrote:
Anyway, I'm just going to wait for C++0x lambdas.
+10000
I came to the same conclusion 3 years ago and stopped working on BOOST_LOCAL_FUNCTION. This was a wrong decision. I'm glad that Lorenzo is working on the library.
Sorry, there is not point in me waiting for C++0x because I can only use standard C++ in my application domain :((
Also, why don't C++0x lambdas support constant binding? (You can only by & or value but not by const& or const value... why?)
I am sure in 10+ years a new embedded platform will come along with C++0x... well, I am not sure but I hope so. However, for now, I am "stock" with C++ (even pure C++ compliant preprocessor and template metaprogramming tricks are seen suspiciously in this domain because it is not clear if suppliers really test for them even if they are part of the C++ standard...).
Lorenzo, can you use typeof (sorry, if you already use it in the implementation, I've not looked at it yet) and variadic macros?
Yes, Boost.Local uses Boost.Typeof to automatically determine the type of the bound variables. I am actually using *exactly* the same mechanism that you Alex programmed for Boost.ScopeExit (with the global variable `extern boost::scope_exit::aux::undeclared ...`, typeof, etc) plus a patch from Adam Butcher to handle `typeof(*this)` on MSVC (see http://lists.boost.org/Archives/boost/2010/08/170253.php). I think you are also asking if I can use typeof and variadic macros on my embedded platform compiler: 1) Yes, I can use typeof because __typeof__ is actually part of the compiler certification process (strangely enough given that is not pure C++... it must be trivial to test for its correctness... I don't know). Also, as I understand it, I can rely on Boost.Typeof (using sizeof() + SFINAE template metaprogramming tricks) to emulate this functionality on pure C++ compilers. 2) No, I cannot use variadic macros because they are not part of the compiler certification process (even if they are actually there because the preprocessor is really a gcc C99 perprocessor). Also a general guideline in for my application domain is to stick with 100% standard to increase portability -- if a new platform comes along the only reasonable assumption is for it to have a pure C++ standard certified compiler (even if the current certified compiler has a C99 preprocessor, the next certified compiler might not -- if they change the hardware a different base compiler than gcc could be used...). (That said, if the embedded platform were to change there will be quite a bit of low level code that will need to be re-written and everything will need to be throughly re-tested so portability has a restricted meaning in this context and I essentially hope nothing changes with my platform, compiler, debugger, etc ;) .) -- Lorenzo