>> <
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0593r2.html>, I
>> assume.
>> But for non-implicit lifetime types, it's just a void* to uninitalized
>> storage?
>>
>>
> Maybe I should have been more explcit. I'm asking if, instead of:
>
> int *p = (int*)operator new(sizeof(int), align_val_t(alignof(int)));
>
> the statement was:
>
> non_impl_life_t *p = (non_impl_life_t*)operator
> new(sizeof(non_impl_life_t), align_val_t(alignof(non_impl_life_t)));
> *p=non_impl_life_t();
>
> where non_impl_life_t is some type that is *not* an implicit lifetime type,
> then the value returned by the
> allocation function would uninitialized storage and the deref and
> assignment in 2nd line would be undefined.
>
> Hmm. Maybe p0593r intends that in both the int and the non_impl_life_t
> examples, the value return by the allocation
> function (i.e. new) is uninitialized storage, but in the int case, the
> compiler would look at the deref & assignment and
> at that point *would* initialize the storage to be an int, making the 2nd
> statement defined behaviour?
This is very close to what p0593 propose:
"""
Therefore we propose the following rule:
Some operations are described as implicitly creating objects within a specified region of storage. The abstract machine creates objects of implicit lifetime types within those regions of storage as needed to give the program defined behavior. For each operation that is specified as implicitly creating objects, that operation implicitly creates zero or more objects in its specified region of storage if doing so would give the program defined behavior. If no such sets of objects would give the program defined behavior, the behavior of the program is undefined.
"""
Although, assignment doesn't seem to be in the list of operations implicitly creating objects.