From ec5ddaa72cfb545ae6ce6472c4bb32903d658fed Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EB=B0=95=EC=A2=85=ED=98=84/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Tue, 11 Sep 2018 13:40:32 +0900 Subject: [PATCH] [coco] Use make_unique without namespace (#1441) This commit introduces 'using' statement for 'make_unique' in Module.cpp. This change will improve code readability, and make it easy to adopt C++ 14 later. Signed-off-by: Jonghyun Park --- contrib/coco/core/src/IR/Module.cpp | 39 +++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/contrib/coco/core/src/IR/Module.cpp b/contrib/coco/core/src/IR/Module.cpp index 629d7dd..876d838 100644 --- a/contrib/coco/core/src/IR/Module.cpp +++ b/contrib/coco/core/src/IR/Module.cpp @@ -2,6 +2,8 @@ #include +using nncc::foundation::make_unique; + namespace { @@ -107,32 +109,31 @@ namespace coco std::unique_ptr Module::create(void) { - auto bag_link = nncc::foundation::make_unique>(); - auto obj_link = nncc::foundation::make_unique>(); - auto op_link = nncc::foundation::make_unique>(); - auto ins_link = nncc::foundation::make_unique>(); - auto blk_link = nncc::foundation::make_unique>(); + auto bag_link = make_unique>(); + auto obj_link = make_unique>(); + auto op_link = make_unique>(); + auto ins_link = make_unique>(); + auto blk_link = make_unique>(); - auto m = nncc::foundation::make_unique<::ModuleImpl>(); + auto m = make_unique<::ModuleImpl>(); - auto mgr = nncc::foundation::make_unique<::EntityManagerImpl>(); + auto mgr = make_unique<::EntityManagerImpl>(); { - mgr->_bag = nncc::foundation::make_unique(bag_link.get()); - mgr->_object = - nncc::foundation::make_unique(obj_link.get(), bag_link.get()); - mgr->_op = nncc::foundation::make_unique(op_link.get(), obj_link.get()); - mgr->_instr = nncc::foundation::make_unique(op_link.get(), ins_link.get(), - obj_link.get(), bag_link.get()); - mgr->_block = nncc::foundation::make_unique(blk_link.get(), ins_link.get()); - mgr->_input = nncc::foundation::make_unique(bag_link.get()); - mgr->_output = nncc::foundation::make_unique(bag_link.get()); + mgr->_bag = make_unique(bag_link.get()); + mgr->_object = make_unique(obj_link.get(), bag_link.get()); + mgr->_op = make_unique(op_link.get(), obj_link.get()); + mgr->_instr = make_unique(op_link.get(), ins_link.get(), obj_link.get(), + bag_link.get()); + mgr->_block = make_unique(blk_link.get(), ins_link.get()); + mgr->_input = make_unique(bag_link.get()); + mgr->_output = make_unique(bag_link.get()); } m->_entity = std::move(mgr); // NOTE BlockManager and BlockList SHOULD share 'blk_link' - m->_block = nncc::foundation::make_unique(m.get(), blk_link.get()); - m->_input = nncc::foundation::make_unique(); - m->_output = nncc::foundation::make_unique(); + m->_block = make_unique(m.get(), blk_link.get()); + m->_input = make_unique(); + m->_output = make_unique(); m->_bag_link = std::move(bag_link); m->_obj_link = std::move(obj_link); -- 2.7.4