« Return to Thread: upcoming Switch library review Jan 5th - Jan 9th

Re: upcoming Switch library review Jan 5th - Jan 9th

by Tobias Schwinger-2 :: Rate this Message:

Reply to Author | View in Thread

Larry Evans wrote:

> The attachment contains an alternative which uses no preprocessing.
> It uses more memory because of the static fun_vec in:
>
>   fun_switch_impl::our_vec
>
> However, it would probably use less code because of no preprocessor
> generated switch statements.  OTOH, it would be slower because
> the function has to be looked up in the vector.
>
> Are there any other comparisons you can think of.  It would be
> useful to outline the pro's and cons of alternative implementations
> you've considered.

We actually very much want a preprocessor-generated 'switch' statement
because it is a special hint for optimization and most compilers
generate very efficient code for it...


Regards,
Tobias

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

 « Return to Thread: upcoming Switch library review Jan 5th - Jan 9th