Message: MarkSelection() creates HashMap and return using std::forward_as_tuple, does this work well to avoid deep copy the HashMap returning back to caller?
On 2017/04/27 09:50:29, yosin_OOO_til_May_7 wrote: > nit: s/auto/const auto&/ > nit: s/iterator/key_value/ or another good name. "iterator" is usually abbrev to > "it" > and used as: > for (auto it = old_selected_blocks.begin(); it != old_selected_blocks.end(); > ++it)
On 2017/04/27 09:50:29, yosin_OOO_til_May_7 wrote: > nit: s/auto/const auto&/ > nit: s/iterator/key_value/ or another good name. "iterator" is usually abbrev to > "it" > and used as: > for (auto it = old_selected_blocks.begin(); it != old_selected_blocks.end(); > ++it)
On 2017/04/27 09:50:29, yosin_OOO_til_May_7 wrote: > nit: s/auto/const auto&/ > nit: s/iterator/key_value/ or another good name. "iterator" is usually abbrev to > "it" > and used as: > for (auto it = old_selected_blocks.begin(); it != old_selected_blocks.end(); > ++it)
On 2017/04/27 09:50:29, yosin_OOO_til_May_7 wrote: > We should move this if-statement to beginning of this function. > Or at least after L281 MarkSelection()
On 2017/04/28 03:21:51, yosin_OOO_til_May_7 wrote: > On 2017/04/28 at 02:16:26, yoichio wrote: > > Does this correctly move |selected_objects| and |selected_blocks| > > to caller w/o deep copy? > > |std::forward_as_tuple()| is used for function argument[1]. > > We should write: > return std::move(std::make_pair(selection_objects, selected_blocks)); > > [1] http://en.cppreference.com/w/cpp/utility/tuple/forward_as_tuple
On 2017/04/28 03:21:51, yosin_OOO_til_May_7 wrote: > I think it is better to introduce |struct SelectedMap { SelectedObjectMap > objects; SelectedBlockMap blocks; }| > Rather than destructuing tuple.