Skip to content

Instantly share code, notes, and snippets.

@bqqbarbhg
Last active December 20, 2015 20:08
Show Gist options
  • Save bqqbarbhg/6188188 to your computer and use it in GitHub Desktop.
Save bqqbarbhg/6188188 to your computer and use it in GitHub Desktop.
error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>'
class AstNode
{
public:
};
typedef std::unique_ptr<AstNode> AstPtr;
typedef std::vector<AstPtr> AstList;
class AstFuncImpl : public AstNode
{
public:
AstFuncImpl(TypedName type, AstList&& list)
: type(type)
, list(std::move(list))
{
}
TypedName type;
AstList list;
private:
AstFuncImpl(const AstFuncImpl&);
AstFuncImpl&operator=(const AstFuncImpl&);
};
if (accept(Token::LBLOCK)) {
if (name.type->ttype != TypeBase::FUNC)
throw CompileError("Expected a function type");
AstList node = parse_block();
require(Token::RBLOCK);
return AstPtr(new AstFuncImpl(name, std::move(node)));
}
class AstCall : public AstExprNode
{
public:
AstCall(AstExprPtr&& func, std::vector<AstExprPtr>&& params)
: func(std::move(func))
, params(std::move(params))
{
}
AstExprPtr func;
std::vector<AstExprPtr> params;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment