@@ -214,18 +214,15 @@ namespace xt
214214 template <class E1 , class E2 >
215215 inline void assign_xexpression (xexpression<E1 >& e1 , const xexpression<E2 >& e2 )
216216 {
217- xtl::mpl::static_if<has_assign_to<E1 , E2 >::value>(
218- [&](auto self)
219- {
220- self (e2 ).derived_cast ().assign_to (e1 );
221- },
222- /* else*/
223- [&](auto /* self*/ )
224- {
225- using tag = xexpression_tag_t <E1 , E2 >;
226- xexpression_assigner<tag>::assign_xexpression (e1 , e2 );
227- }
228- );
217+ if constexpr (has_assign_to<E1 , E2 >::value)
218+ {
219+ e2 .derived_cast ().assign_to (e1 );
220+ }
221+ else
222+ {
223+ using tag = xexpression_tag_t <E1 , E2 >;
224+ xexpression_assigner<tag>::assign_xexpression (e1 , e2 );
225+ }
229226 }
230227
231228 template <class E1 , class E2 >
@@ -320,7 +317,7 @@ namespace xt
320317 template <class F , class ... CT>
321318 struct use_strided_loop <xfunction<F, CT...>>
322319 {
323- static constexpr bool value = xtl ::conjunction<use_strided_loop<std::decay_t <CT>>...>::value;
320+ static constexpr bool value = std ::conjunction<use_strided_loop<std::decay_t <CT>>...>::value;
324321 };
325322
326323 /* *
@@ -585,31 +582,28 @@ namespace xt
585582 template <class E1 , class F , class ... CT>
586583 inline bool xexpression_assigner<Tag>::resize(E1 & e1 , const xfunction<F, CT...>& e2 )
587584 {
588- return xtl::mpl::static_if<detail::is_fixed<typename xfunction<F, CT...>::shape_type>::value>(
589- [&](auto /* self*/ )
590- {
591- /*
592- * If the shape of the xfunction is statically known, we can compute the broadcast triviality
593- * at compile time plus we can resize right away.
594- */
595- // resize in case LHS is not a fixed size container. If it is, this is a NOP
596- e1 .resize (typename xfunction<F, CT...>::shape_type{});
597- return detail::static_trivial_broadcast<
598- detail::is_fixed<typename xfunction<F, CT...>::shape_type>::value,
599- CT...>::value;
600- },
601- /* else */
602- [&](auto /* self*/ )
603- {
604- using index_type = xindex_type_t <typename E1 ::shape_type>;
605- using size_type = typename E1 ::size_type;
606- size_type size = e2 .dimension ();
607- index_type shape = uninitialized_shape<index_type>(size);
608- bool trivial_broadcast = e2 .broadcast_shape (shape, true );
609- e1 .resize (std::move (shape));
610- return trivial_broadcast;
611- }
612- );
585+ if constexpr (detail::is_fixed<typename xfunction<F, CT...>::shape_type>::value)
586+ {
587+ /*
588+ * If the shape of the xfunction is statically known, we can compute the broadcast triviality
589+ * at compile time plus we can resize right away.
590+ */
591+ // resize in case LHS is not a fixed size container. If it is, this is a NOP
592+ e1 .resize (typename xfunction<F, CT...>::shape_type{});
593+ return detail::static_trivial_broadcast<
594+ detail::is_fixed<typename xfunction<F, CT...>::shape_type>::value,
595+ CT...>::value;
596+ }
597+ else
598+ {
599+ using index_type = xindex_type_t <typename E1 ::shape_type>;
600+ using size_type = typename E1 ::size_type;
601+ size_type size = e2 .dimension ();
602+ index_type shape = uninitialized_shape<index_type>(size);
603+ bool trivial_broadcast = e2 .broadcast_shape (shape, true );
604+ e1 .resize (std::move (shape));
605+ return trivial_broadcast;
606+ }
613607 }
614608
615609 /* **********************************
0 commit comments