Tutorial by Examples: copies

If a remote branch has been deleted, your local repository has to be told to prune the reference to it. To prune deleted branches from a specific remote: git fetch [remote-name] --prune To prune deleted branches from all remotes: git fetch --all --prune
To create a collection of n copies of some object x, use the fill method. This example creates a List, but this can work with other collections for which fill makes sense: // List.fill(n)(x) scala > List.fill(3)("Hello World") res0: List[String] = List(Hello World, Hello World, Hello...
A struct can simply be copied using assignment. type T struct { I int S string } // initialize a struct t := T{1, "one"} // make struct copy u := t // u has its field values equal to t if u == t { // true fmt.Println("u and t are equal") // Prints: &qu...
Expanding the parameter pack of indices in a comma expression with a value creates a copy of the value for each of the indices. Sadly, gcc and clang think the index has no effect and warn about it (gcc can be silenced by casting the index to void): #include <algorithm> #include <array>...

Page 1 of 1