
C++
1
Вклад в тег
class MyClass {
public:
template <typename T>
T get();
};
template <typename T>
T MyClass::get() {
T val;
val = 42;
return val;
}
template <>
char* MyClass::get<char *>() {
return "foo";
}