I stumbled across the following:
template<> inline bool Value::GetValue<bool>() const {
return m_Value.ValueBoolean(); // union
}
Can’t understand what the empty template declaration does ?
I stumbled across the following:
template<> inline bool Value::GetValue<bool>() const {
return m_Value.ValueBoolean(); // union
}
Can’t understand what the empty template declaration does ?
This is an explicit specialization of a template function for type bool
. Explicit specialization is where template <>
syntax is used.
template <typename T> void foo(T t) // Main template
{
...
}
template <> void foo<bool>(bool b) // Explicit specialization for type `bool`
{
...
}
The fact that in your example it is applied to a template of a class member function is completely inconsequential. The fact that the function is declared inline
is also completely besides the point.