Last active
December 20, 2015 20:08
-
-
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>'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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&); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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