I want to have something like that
class A
{
public:
Array& operator()()
{ . . . }
};
class B
{
public:
Element& operator[](int i)
{ ... }
};
template<class T>
class execute
{
public:
output_type = operator()(T& t)
{
if(T == A)
Array out = T()();
else
{
Array res;
for(int i=0 ; i < length; ++i)
a[i] = t[i];
}
}
};
There are two issues here:
- meta-function replacing if-else in the execute operator()
- return type of execute operator()
Thanks in anticipation,
Noman