When the documentation says "C++ template parameters can also be used as receivers or parameters (though not as selectors) in Objective-C message expressions", that means that you can call an Objective-C method from within a templated C++ class or function, not that you can actually make a templated Objective-C method.
For example:
template<typename T>
void f(id obj, T t) {
[obj doSomethingWithObject:t];
}
...should work (although I haven't tested it). Of course, the type used when calling f
would have to be something that could validly be passed as a parameter to doSomethingWithObject:
, otherwise the calling code wouldn't compile.