Mac build fails, PC build OK
-
I have converted an R16-R19 plugin to R20 on PC.
After resolving all compiler issues. I copy the adjusted source files, res files to Mac.
There the build reportsNo viable conversion from 'maxon::Bool' (aka 'bool') to 'Result<void>'
and this for line 2286 in apibase.h
Result<void> res = dst.CopyFrom(src);
It seems related to a class I provided, disallowing copy and assign. And for which I have provided a CopyFrom method.
Strangly enough, I have providedclass MyObject { MAXON_DISALLOW_COPY_AND_ASSIGN(MyObject); public: ... maxon::Bool CopyFrom(const MyObject& src);
A return type of
maxon::Bool
, which is also mentioned in the Code Style Guide point 9.6.while the R19 documentation indicates
MAXON_WARN_UNUSED Result<void> CopyFrom(const Example1& src)
Looking at my code, it seems I got it wrong.
The R16-R19 implementation uses a Bool as return type, while it should be a Result<void>, still all compiles fine, and runs fine as well. (both PC and Mac)
The R20 implementation uses a Bool, which should be OK according to the documentation, compiles fine on PC but that fails to compile on Mac.EDIT:
The R20 SDK example (Move/Copy Constructors) also contains:maxon::Result<void> CopyFrom(const Example3& src)
I am confused
-
Think I got it resolved.
Seems the correct implementation should indeed bemaxon::Result<void> CopyFrom(const Example3& src)
as the arraytutorial.cpp and movecopyconstructor.cpp examples from the R20 SDK indicate.
Please update the Code Style Guide point 9.6 to show the correct way to go for a CopyFrom.
Thanks for watching.
-
I had a "deja vu" moment, and indeed ... seems I already once hit that same wall here
Funny that Visual Studio never once complained about the
maxon::Bool CopyFrom
.