Boost logo

Boost :

Subject: Re: [boost] [Variant] C++11 variadic template implementation
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-04-15 19:12:18

on Sun Apr 15 2012, Mathias Gaunard <> wrote:

> On 15/04/12 15:02, paul Fultz wrote:
>> Well you can expand the parameter pack to create a static array of
>> function pointers.
> I see, interesting.
> How does it fare in terms of bloat and performance? Are compilers
> still able to inline with this?

You can probably get somewhere by using constexpr to ensure that
function pointers remain compile-time constants. However, note that
such a dispatch may still be less efficient than a switch statement or
chained if/then/else.

Dave Abrahams
BoostPro Computing

Boost list run by bdawes at, gregod at, cpdaniel at, john at