mardi 19 juin 2018

Is it possible to alias a template function member of a template class?

There is a way to alias a function template member of a template class?

for instance let's take

temmplate<typename T, int ndim>
class Point
{
  // ... stuff

  template<int index>
  T get() const;   
}

instead of using p.get<0>() does exists a way to declare an alias like

using getX() =  template<typaname T, ndim> Point<T,ndim>::get()
p.getX() // call p.get<0>()

?

I'm aware of the fact I could write an enable_if getX which wraps get<0>() enabled if ndims match it. I'd like to know if does exists a way through aliasing.

Aucun commentaire:

Enregistrer un commentaire