MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ set_custom_comparator()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
template<typename T >
void MayaFlux::Yantra::UniversalSorter< InputType, OutputType >::set_custom_comparator ( std::function< bool(const T &, const T &)>  comparator)
inline

Configure custom comparator for CUSTOM direction.

Parameters
comparatorCustom comparison function

Definition at line 274 of file UniversalSorter.hpp.

275 {
276 m_custom_comparator = [comparator](const std::any& a, const std::any& b) -> bool {
277 auto val_a_result = safe_any_cast<T>(a);
278 auto val_b_result = safe_any_cast<T>(b);
279 if (val_a_result && val_b_result) {
280 return comparator(*val_a_result, *val_b_result);
281 }
282 return false;
283 };
284 }
std::function< bool(const std::any &, const std::any &)> m_custom_comparator