this
no matching function for call to 'SE::ShockRenderSystem::ShockRenderSystem(std::shared_ptr<SE::ShockGame>*, sf::VideoMode&)' candidate is: SE::ShockRenderSystem::ShockRenderSystem(std::shared_ptr<ShockGame>, sf::VideoMode)
thanks对任何帮助!
来自
ShockGame
的derive
std::enable_shared_from_this
std::enable_shared_from_this
和
shared_from_this()
的使用,但它们的用法有些怪异。这是一个例子,可能会有所帮助。
#include <memory>
//The class must inherit from std::enable_shared_from_this.
template <typename K, typename V>
struct TreeNode : public std::enable_shared_from_this<TreeNode<K, V>>
{
std::shared_ptr<TreeNode<K, V>> find(K key) {
//Must call shared_from_this() using this->.
std::shared_ptr<TreeNode<K, V>> root = this->shared_from_this();
//...
}
}