d*******n 发帖数: 369 | 1 1.
#include
class ExtraInfo
{
...
};
class ExtraInfoString : public std::string
{
ExtraInfo *mExtraInfo;
public:
inline ExtraInfoString() : mExtraInfo(new ExtraInfo())
{
}
inline ~ExtraInfoString()
{
delete mExtraInfo;
mExtraInfo = 0;
}
inline ExtraInfo *GetExtraInfo()
{
return mExtraInfo;
}
inline const ExtraInfo *GetExtraInfo() const
{
return mExtraInfo;
}
};
void main()
{
std::string *s = new E |
|