Posts

Showing posts from 2018

Docker Images: Backup and Recovery

Backup : docker save -o image_path/image_name.tar image_name:image_tag Recovery : # docker load -i image_path/image_name.tar

C++ 11 Range Based Loop

Repost from https://stackoverflow.com/questions/15176104/c11-range-based-loop-get-item-by-value-or-reference-to-const If you don't want to change the items as well as want to  avoid  making copies, then  auto const &  is the correct choice: for ( auto const & x : vec ) Here is recap: Choose  auto x  when you want to work with copies. Choose  auto &x  when you want to work with original items and may modify them. Choose  auto const &x  when you want to work with original items and will not modify them.