@@ -717,34 +717,33 @@ namespace ROOT {
717717 template <class Func >
718718 void TF1Builder<Func>::Build(TF1 *f, Func func)
719719 {
720+ #ifdef R__HAS_STD_SIMD
720721 // check if vector interface is supported by Func
721722 if constexpr (std::is_invocable_r_v<Double_v, Func, Double_v*, double *>) {
722- // if ROOT was not built with std::experimental::simd support, Double_v is just an alias for the scalar
723- // double
724- f->fType = std::is_same<Double_v, double >::value ? TF1::EFType::kTemplScalar : TF1::EFType::kTemplVec ;
723+ f->fType = TF1::EFType::kTemplVec ;
725724 f->fFunctor .reset (new TF1::TF1FunctorPointerImpl (ROOT::Math::ParamFunctorTempl<Double_v>(func)));
726- } else {
727- f->fType = TF1::EFType::kTemplScalar ;
728- f->fFunctor .reset (new TF1::TF1FunctorPointerImpl (ROOT::Math::ParamFunctorTempl<double >(func)));
725+ f->fParams = std::make_unique<TF1Parameters>(f->fNpar );
729726 }
727+ #endif
730728
729+ f->fType = TF1::EFType::kTemplScalar ;
730+ f->fFunctor .reset (new TF1::TF1FunctorPointerImpl (ROOT::Math::ParamFunctorTempl<double >(func)));
731731 f->fParams = std::make_unique<TF1Parameters>(f->fNpar );
732732 }
733733
734734 template <class Func >
735735 void TF1Builder<Func *>::Build(TF1 *f, Func *func)
736736 {
737+ #ifdef R__HAS_STD_SIMD
737738 // check if vector interface is supported by Func
738739 if constexpr (std::is_invocable_r_v<Double_v, Func, Double_v*, double *>) {
739- // if ROOT was not built with std::experimental::simd support, Double_v is just an alias for the scalar
740- // double
741- f->fType = std::is_same<Double_v, double >::value ? TF1::EFType::kTemplScalar : TF1::EFType::kTemplVec ;
740+ f->fType = TF1::EFType::kTemplVec ;
742741 f->fFunctor .reset (new TF1::TF1FunctorPointerImpl (ROOT::Math::ParamFunctorTempl<Double_v>(func)));
743- } else {
744- f->fType = TF1::EFType::kTemplScalar ;
745- f->fFunctor .reset (new TF1::TF1FunctorPointerImpl (ROOT::Math::ParamFunctorTempl<double >(func)));
742+ f->fParams = std::make_unique<TF1Parameters>(f->fNpar );
746743 }
747-
744+ #endif
745+ f->fType = TF1::EFType::kTemplScalar ;
746+ f->fFunctor .reset (new TF1::TF1FunctorPointerImpl (ROOT::Math::ParamFunctorTempl<double >(func)));
748747 f->fParams = std::make_unique<TF1Parameters>(f->fNpar );
749748 }
750749
0 commit comments