I'm developing a sort of pseudo-ORM system, and I'm having a little trouble getting part of it to work.
I have a concept that looks like this:
Code:
template<typename T>
concept bool DbColumnType()
{
return requires ()
{
std::is_base_of<DbColumnBase, T>::value;
};
}
and then I have a class called Query, which has a function Select(), which looks like this:
Code:
template <DbColumnType... Args>
QueryWithRowType<tableT, Args...> Select(const Args&... columns)
{
m_selectColumns.clear();
SelectInternal(columns...);
return QueryWithRowType<tableT, Args...>(*this);
}
QueryWithRowType is derived from Query.
I'm getting errors from this code like the following:
Code:
In file included from include/tables.h:10:0,
from src/otherOrmTest.cpp:6:
include/Query.h: In instantiation of ‘class Query<table1>’:
src/otherOrmTest.cpp:12:26: required from here
include/Query.h:233:39: error: invalid use of pack expansion expression
QueryWithRowType<tableT, Args...> Select(const Args&... columns)
^~~~~~
And I'm just wondering if there is a correct syntax for using concepts with parameter packs, or if that scenario has been overlooked, thus far.
Anyone have some insight?