|
Boost : |
From: Matus Chochlik (chochlik_at_[hidden])
Date: 2008-06-09 13:11:08
On Sat, Jun 7, 2008 at 10:53 AM, Joel FALCOU <joel.falcou_at_[hidden]> wrote:
>> the meta_class specializations for the templates like pair, vector, tuple, etc.
>> are currently hand-coded, and using some common boilerplate to handle
>> the template param names, but I'm working on some registering macros
>> similar to Joel's.
>> see for example:
>> http://svn.boost.org/svn/boost/sandbox/mirror/boost/mirror/meta_classes/std_pair.hpp
>
> Seems mirror has a far broader usage than my humnle identify<> !
> I like the possibility of reflecting any parts of a type adn I also
> understand the gap between this task and mine.
>
> My macro in fact really simple, I "cheat" by using MPL_AUX_LAMBDA_ARITY
> to detect the number of tempalte parameters and generate the proper
> specialisation. When it fails, I use a small preprocessor macro using
> sequence to generate the proper display.
>
> Other difference is my use of std::string as a return type. Seems you
> have a complex system to compute string length and use char*. Not sure
> which one is the best but I'm willing to hear the rationale behind this
> choice.
Well there is no bulletproof ;) rationale behind this. I've made some
performance
tests with both char* buffer and with ::std::string and char* buffer did better.
When formatting the type name of a complicated template there is a lot of
string copying and realocation.
Calculating the type-name string lenght was not a big issue. The problem
with the current implementation is that there are some memory leaks
at the program exit but they are not cumulative, but still, fixing this is
on my TODO list ;)
>
> --
> Joel FALCOU
> Research Engineer @ Institut d'Electronique Fondamentale
> Université PARIS SUD XI
> France
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- ________________ ::matus_chochlik
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk