S
sebastian
Hi,
I'd like to specialize a template function that contains a template
parameter. In Example i have the following function declared:
....
template < int i > static stupid_object& doSomething( int i,
const another_stupid_object& __aso);
....
and now i would like to specialize this function for i equals 6.
How can i realize this ?:
....
template<> stupid_object& doSomething( ???? ) {
....
}
....
In the broader sens what happens if the template-argument is not of a
simple type like "int" but an own declared object (i.E. "own_object").
Which operators do i have to overwrite ? Is there any documentation about
this ?
Unfortunately Stroustrup doesn't write anything about this case. Is
it generally realizable/implementable ???
Thanx in advance
cheers
sebastian
I'd like to specialize a template function that contains a template
parameter. In Example i have the following function declared:
....
template < int i > static stupid_object& doSomething( int i,
const another_stupid_object& __aso);
....
and now i would like to specialize this function for i equals 6.
How can i realize this ?:
....
template<> stupid_object& doSomething( ???? ) {
....
}
....
In the broader sens what happens if the template-argument is not of a
simple type like "int" but an own declared object (i.E. "own_object").
Which operators do i have to overwrite ? Is there any documentation about
this ?
Unfortunately Stroustrup doesn't write anything about this case. Is
it generally realizable/implementable ???
Thanx in advance
cheers
sebastian