From: 박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 Date: Mon, 4 Jun 2018 07:09:51 +0000 (+0900) Subject: [foundation] Do NOT allow copy/move on OwnedRegion (#299) X-Git-Tag: nncc_backup~2629 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2bc8ae28af28548151f9e53ca6005f189db050f1;p=platform%2Fcore%2Fml%2Fnnfw.git [foundation] Do NOT allow copy/move on OwnedRegion (#299) As its name suggestes, OwnedRegion should not be copied. OwnedRegion should be moveable simialrly as std::unique_ptr, but the current implementation sets '_base' field as const field, so it is impossible to implement move constructor. As a workaround, this commit disables move on Owned Region temporarily. Signed-off-by: Jonghyun Park --- diff --git a/libs/foundation/include/nncc/foundation/OwnedRegion.h b/libs/foundation/include/nncc/foundation/OwnedRegion.h index 2d8f463..0451996 100644 --- a/libs/foundation/include/nncc/foundation/OwnedRegion.h +++ b/libs/foundation/include/nncc/foundation/OwnedRegion.h @@ -17,6 +17,12 @@ public: } public: + // Copy and move is not allowed + // TODO Allow move + OwnedRegion(const OwnedRegion &) = delete; + OwnedRegion(OwnedRegion &&r) = delete; + +public: ~OwnedRegion() { delete[] _base; } public: