T
Tim H
I have a template class 'Property' that has a ValueType typedef in it.
I have a method of another class that looks like this:
template<class Tkey>
const typename Tkey::ValueType &GetProperty() const { ... }
I want to support Properties with void ValueType. I added a
specialization of Property and that works. what fails is when code
calls the above GetProperty<VoidProperty>() method. I get a "no
matching function" error (g++).
It looks like SFINAE is correctly determining that a 'const void &' is
an error. The error message is not very helpful, though.
How can I use SFINAE (or other tricks) to make calls to
GetProperty<VoidProperty>() blow up in a more obvious manner?
I have a method of another class that looks like this:
template<class Tkey>
const typename Tkey::ValueType &GetProperty() const { ... }
I want to support Properties with void ValueType. I added a
specialization of Property and that works. what fails is when code
calls the above GetProperty<VoidProperty>() method. I get a "no
matching function" error (g++).
It looks like SFINAE is correctly determining that a 'const void &' is
an error. The error message is not very helpful, though.
How can I use SFINAE (or other tricks) to make calls to
GetProperty<VoidProperty>() blow up in a more obvious manner?