Question: How can I position a mask loading layer and its message in the vertical and horizontal center while the view is still rendering? I want my controller to handle it. Is there another solution than masking after rendering?

What I tried:

`oView.getEl().mask( "Loading..." );` this will be displayed before rendering is done. The message box is displayed at the top of the panel. `setloading`'s message is what I want. However:

* `setLoading()` is not locked to the panel/view. If you drag the window/panel, the loading mask with message stays in the drag start and does not move with its window/panel. The loading message works perfectly `setLoading( 'Waiting...' );`
* `mask()` locks to the panel/view (yea!). But it gets displayed at the panel's top not center.

Answer: 
I couldn't quite understand your question, but to respond to the understanding you listed: Your understanding *may be correct on a particular compiler/day/build*. It is *unspecified* whether you will insert at `begin` or `begin + 1` (which then results in the value returned from `insert` being one of two different possible values) because the compiler may evaluate the arguments to `insert` in any order it likes. Instead of trying to work out exactly what will happen, split the code into appropriate pieces the make it perfectly clear what you're trying to do and let the optimizer take care of things for you. Almost certainly the reason it core dumped is because when you increment by two you skip over `end` and never detect that you passed the end of the container.

I feel I should also point out that "luckily" there's a sequence point after the evaluation of function arguments, or `begin = target.insert(begin, *begin++);` would be undefined behavior with two writes to `begin` and no intervening sequence point (for example `i = i++` is UB).
AFAIK you construct target.insert(iter, \*iter++) is not legal c++, as it leads to 'undefined behavior'. \*iter++ is legal, and is evaluated left-to-right, but order in which agruments of a function call are evaluated is not specified. Writing such an expression is a programming error.

to be precise, your code 

```
target.insert(iter, *iter++)

```

given aliases

```
std::vector<int>::iterator cur = iter;
std::vector<int>::iterator next = iter + 1;

```

can be evaluated in these 2 ways

```
targets.insert(next, *cur);
++iter;

```

or

```
targets.insert(cur, *cur);
++iter;

```

the exact version is a subject to compiler, os, other code etc and is generally not specified.