如何解决该文档是否缺少任何内容?
| 我已经写了一个非常简单的类的文档,但是我感觉还不够清楚。我应该改变什么吗?/**
Pointer class that wraps resources loaded through the ResourceManager.
The manager is notified to increase or decrease the reference count of
a resource,as a ResourcePtr gets copied,created,or deleted.
If a resource has a reference count of zero,the ResourceManager will
delete it. The reference count of a resource is the same as the number
of ResourcePtr objects that reference it.
\\see ResourceManager
*/
template<class T>
class ResourcePtr
{
public:
/**
Default constructor. Creates an empty ResourcePtr that does not
reference any resource.
*/
ResourcePtr();
/**
Copy constructor. Create a copy and increase the reference count
of the resource referenced by the ResourcePtr being copied,if any.
*/
ResourcePtr(const ResourcePtr<T>& other);
/**
Destroy the ResourcePtr and release one reference to the resource
it points to,if any. The resource is deleted if there are no more
ResourcePtr objects that reference it.
*/
~ResourcePtr();
/**
Access the resource inside the ResourcePtr.
\\return Pointer to the resource or null if ResourcePtr is empty.
*/
const T* get() const;
/**
Arrow operator. Provided for convenience to access members of
the resource class directly,without having to first call get().
An assertion failure occurs if the ResourcePtr is empty.
*/
const T* operator->() const;
/**
Assignment operator. Release the resource currently pointing to,if any. Copy the data from the other ResourcePtr and increase
the reference count of the resource it points to,if any.
*/
ResourcePtr<T>& operator=(const ResourcePtr<T>& other);
private:
friend class ResourceManager<T>;
typename std::list<typename
ResourceManager<T>::ResourceWrapper*>::iterator iter_;
};
解决方法
您会错过这些注释都是多余的事实,只会使代码更难以阅读和理解。它们等效于:
i++; // increment i
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。