MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / applyElementwise

Function applyElementwise

source/MRViewer/MRImGuiVectorOperators.h:73–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71 // Scalar parameters are accepted too.
72 template <typename F, typename ...P> requires detail::ValidOperands<P...>
73 [[nodiscard]] constexpr auto applyElementwise( F&& func, P&&... params ) -> typename detail::VecFromSize<detail::CommonVecSize<P...>::value>::type
74 {
75 constexpr int n = detail::CommonVecSize<P...>::value;
76 typename detail::VecFromSize<n>::type ret;
77 for (int i = 0; i < n; i++)
78 getElem( i, ret ) = func( getElem( i, params )... );
79 return ret;
80 }
81
82 // Reduces a vector over a binary `func`.
83 template <typename F, detail::VectorOrScalarMaybeCvref T>

Callers 4

operator-Function · 0.85
operator+Function · 0.85
operator*Function · 0.85
operator/Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected