From f5445decc4d8e2893b3bc6bcddd9f23b065b55c1 Mon Sep 17 00:00:00 2001 From: elaine <63917785+pujiangxin@users.noreply.github.com> Date: Sat, 15 Jun 2024 17:14:17 +0800 Subject: [PATCH] [bugfix] fix compile in window error C2556 (#389) Co-authored-by: beggargangs <1178786295@qq.com> --- CONTRIBUTORS.md | 1 + src/GraphCtrl/GraphAspect/GAspectObject.cpp | 3 +-- src/GraphCtrl/GraphAspect/GAspectObject.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1bc04e8a..0827b287 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -25,5 +25,6 @@ Contributors: - [PaPaPig-Melody](https://github.com/PaPaPig-Melody) - [jiangliu123456](https://github.com/jiangliu123456) - [PolarLinda6](https://github.com/PolarLinda6) +- [pujiangxin](https://github.com/pujiangxin) 感谢以上朋友,为CGraph项目做出的贡献,排名以贡献时间前后为顺序。 diff --git a/src/GraphCtrl/GraphAspect/GAspectObject.cpp b/src/GraphCtrl/GraphAspect/GAspectObject.cpp index febba579..8491456a 100644 --- a/src/GraphCtrl/GraphAspect/GAspectObject.cpp +++ b/src/GraphCtrl/GraphAspect/GAspectObject.cpp @@ -27,8 +27,7 @@ GAspectObject::~GAspectObject() { } -auto GAspectObject::setBelong(GElementPtr belong) --> decltype(this) { +GAspectObjectPtr GAspectObject::setBelong(GElementPtr belong) { CGRAPH_ASSERT_NOT_NULL_THROW_ERROR(belong) CGRAPH_THROW_EXCEPTION_BY_CONDITION(!belong->isRegistered(), \ "[" + belong->getName() + "] can not add aspect for the reason of no register"); diff --git a/src/GraphCtrl/GraphAspect/GAspectObject.h b/src/GraphCtrl/GraphAspect/GAspectObject.h index 90cdffde..d174750c 100644 --- a/src/GraphCtrl/GraphAspect/GAspectObject.h +++ b/src/GraphCtrl/GraphAspect/GAspectObject.h @@ -48,7 +48,7 @@ class GAspectObject : public GraphObject, * @param belong * @return */ - auto setBelong(GElement* belong)-> decltype(this); + GAspectObject* setBelong(GElement* belong) ; const std::string& getName() const override;