Nov 14, 2019 at 12:40am
You're not using C or D in your function template, so just ignore them!
1 2 3 4 5
|
template <typename... Ts>
std::vector<Model::Category> getCategoriesSortedBy(Ts... fields)
{
// e.g. ORM::Storage::getStorage().get_all<Model::Category>(order_by(fields)...);
}
|
Last edited on Nov 14, 2019 at 4:14am
Nov 14, 2019 at 8:00am
The problem here is the result 'collection'. Does get_all<...>(...) support multiple fields (like mbozzi assumed) or not?
Nov 14, 2019 at 10:18pm
template<typename ...Ts>
std::vector<Model::Category> getCategoriesSortedBy( Ts ... fields)
{
using namespace sqlite_orm;
using namespace Model;
auto collection = ORM::Storage::getStorage().get_all<Model::Category>(multi_order_by(order_by(fields)...));
return collection;
}