Closed xkungfu closed 2 years ago
Your one-liner looks good. The only thing is you are not specifying all the required types in the template type list. C++ is a statically typed language, so all types must be known at compile Time. So you need this:
df.get_data_by_sel<double, decltype(functor), double, std::string>("col_1", [](const unsigned long &, const double &val)-> bool { return (val >= 5); });
Again, without reading the document you are going to have hard time making this work
thank you! I think "decltype(functor)" would trigger error: "undeclared identifier 'functor'". how to remove or modify it?
typedef it in advance. In the first place, why do you need to this in one line?
"get_data_by_sel" is a common function often to use , so the codes would be not pretty if use it too many times. I just want know if there is a way to merge to one line. It is not necessary. you would continue to do the more important work than it.
how to merge the codes about selecting to one line like below?
auto result = df.get_data_by_sel<double, std::string>("col_1", [](const unsigned long &, const double &val)-> bool { return (val >= 5); });