I'm trying to do automatic type deduction but it should only work if the inputs are fields.
I have declared a function like this:
template<class C> C gettype();
And I use it like this:
template<class L, class R, int F = CField<L,R>::is>
struct AddType {
typedef decltype (gettype<L>() + gettype<R>()) type;
};
but I get a plethora of errors:
- that
getType
cannot be used as a parameter. - that the compiler expects a ';' at the call to decltype. and that I need type specifiers.
etc.
Am I missing a lib or am I thinking about this all wrong?
thanks in advance!
Aucun commentaire:
Enregistrer un commentaire