? . .
#import <Foundation/Foundation.h>
template <typename T>
class U {
protected:
T* a;
public:
U() { a = [[T alloc] init]; }
~U() { [a release]; }
};
class V : U<NSMutableString> {
public:
V(int i) : U<NSMutableString>() { [a appendFormat:@"%d = 0x%x\n", i, i]; }
void print() const { NSLog(@"%@", a); }
};
int main() {
U<NSAutoreleasePool> p;
V s(16);
s.print();
return 0;
}