Sunday 28 August 2016

Git cherry-pick

https://git-scm.com/docs/git-cherry-pick
https://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html

Real-life usage example:

https://community.openvpn.net/openvpn/wiki/CodeRepositories:

Release branches do not have any active development and only bug fixes are typically applied to these branches after the release. A new release branch is created for each major release (2.x). All bug fixes should be developed against the master branch, and where it is decided to include such fixes in a minor release (2.1.x, 2.2.x, etc), it will be cherry-picked from the master branch and into the suitable release branches.

Saturday 27 August 2016

Git rebase

https://www.kernel.org/pub/software/scm/git/docs/git-rebase.html

Real-life usage example:
https://community.openvpn.net/openvpn/wiki/CodeRepositories:
"Developers being granted a feature branch must ensure that their branch is regularly ​rebased against the master branch."


Thursday 25 August 2016

C++ Explicit Constructor

List 5 cases when implicit conversion is performed.
List 6 cases when copy initialization is performed.
What is the purpose of explicit constructor?



References:
http://en.cppreference.com/w/cpp/language/implicit_conversion
http://en.cppreference.com/w/cpp/language/copy_initialization

Wednesday 24 August 2016

C++ Copy Constructor

What is a difference between copying and cloning an object?
What is a copy constructor? (What is its purpose?)
What are its arguments?
What is implicit and what is user-defined copy-constructor?
When does compiler create copy-constructor?
When is needed a user-defined copy-constructor? Why? What else is then also needed?
What is the Rule of three?
Is there any other way to copy objects apart from using copy-constructor?
Give some examples of copy constructor signatures. Which one is preferred?
Which versions of copy constructor are called in the following code snippet?
a) X x = X(); 
b) const X x1;    
   X x2 = x1;
Why are these constructors not valid copy-constructors?
a) X(X x) 
b) X(const X x)
In which situations is called copy-constructor? (List 5 cases of copy-initialization.)
What is Return value optimization?

TBC...

References:

http://stackoverflow.com/questions/2200409/what-is-the-difference-between-copying-and-cloning
https://en.wikipedia.org/wiki/Object_copying
https://en.wikipedia.org/wiki/Cloning_(programming)
https://en.wikipedia.org/wiki/Copy_constructor_(C%2B%2B)
https://en.wikipedia.org/wiki/Rule_of_three_(C%2B%2B_programming)