> On Oct. 8, 2015, 7:40 p.m., Anand Mazumdar wrote:
> > src/slave/containerizer/provisioner/docker/store.cpp, line 202
> > <https://reviews.apache.org/r/39141/diff/1/?file=1093307#file1093307line202>
> >
> >     In this particular case, `push_back` would also do a `std::move` for a 
> > temporary object and I wonder why do we even need `emplace_back` here ?
> >     
> >     I even don't know if an overload like `emplace_back(T&& value)` even 
> > existed and how does it compile even ?
> >     
> >     http://en.cppreference.com/w/cpp/container/vector/emplace_back

post c++11, emplace_back is the preferred way to insert into containers, 
especially when dealing with temporaries. The only reason to use push_back is 
if you want to support pre-c++11 compilers.


- Jojy


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39141/#review101951
-----------------------------------------------------------


On Oct. 8, 2015, 7:30 p.m., Jojy Varghese wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39141/
> -----------------------------------------------------------
> 
> (Updated Oct. 8, 2015, 7:30 p.m.)
> 
> 
> Review request for mesos and Timothy Chen.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Store: minor style changes
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/provisioner/docker/store.cpp 
> cbb67686d45513f0395a0cf1bc5c43cb4935adae 
> 
> Diff: https://reviews.apache.org/r/39141/diff/
> 
> 
> Testing
> -------
> 
> make check.
> 
> 
> Thanks,
> 
> Jojy Varghese
> 
>

Reply via email to