2015-08-28 10:59 GMT+03:00 Andrew Haley <aph@xxxxxxxxxx>: > On 08/27/2015 04:34 PM, Matwey V. Kornilov wrote: >> I use gcc-4.8.2 and see that arr[index](std::forward<T>(p), func) call >> is not inlined. >> The question here is the following. All function pointers are known at >> compile time. So, why don't expand this code into analogous to the >> following? > > I suspect that no-one has explained because no-one understands why > anyone would want to make such an "optimization". > The question arised from here: http://stackoverflow.com/questions/32235855/ Moreover, clang does this kind of optimization: http://goo.gl/jnY5yx -- With best regards, Matwey V. Kornilov http://blog.matwey.name xmpp://0x2207@xxxxxxxxx