Copy from 5.34 patches optimisation in HistFactory (FlexibleInt. and PicewiseInt.)
Apply a patch from Bertrand to fix warning C4436 from VS
(dynamic_cast from virtual base 'class1' to 'class2' in constructor or destructor )