You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
memcpy(&_address[IPADDRESS_V4_BYTES_INDEX], &address, 4); // This method guarantees a defined behavior. Any pointer conversions to write to ADDRESS storage (as a multibyte integer) are undefined behavior when the lifetime of the multibyte type has not previously started.
43
+
44
+
// C++ standard draft [basic.life#7](https://eel.is/c++draft/basic.life#7)
45
+
// Before the lifetime of an object has started but after the storage which the object
46
+
// will occupy has been allocated or, after the lifetime of an object has ended and
47
+
// before the storage which the object occupied is reused or released, any pointer that
48
+
// represents the address of the storage location where the object will be or was
49
+
// located may be used but only in limited ways. For an object under construction or
50
+
// destruction, see [class.cdtor]. Otherwise, such a pointer refers to allocated storage
51
+
// ([basic.stc.dynamic.allocation]), and using the pointer as if the pointer were of
52
+
// type void* is well-defined. Indirection through such a pointer is permitted but the
53
+
// resulting lvalue may only be used in limited ways, as described below.
54
+
// The program has undefined behavior if
55
+
// --the pointer is used as the operand of a delete-expression,
56
+
// --the pointer is used as the operand of a static_cast ([expr.static.cast]), except
57
+
// when the conversion is to pointer to cv void, or to pointer to cv void and subsequently
58
+
// to pointer to cv char, cv unsigned char, or cv std::byte ([cstddef.syn]), or
59
+
60
+
// C++ standard draft [basic.life#8](https://eel.is/c++draft/basic.life#8)
61
+
// Similarly, before the lifetime of an object has started but after the storage which
62
+
// the object will occupy has been allocated or, after the lifetime of an object has
63
+
// ended and before the storage which the object occupied is reused or released, any
64
+
// glvalue that refers to the original object may be used but only in limited ways.
65
+
// For an object under construction or destruction, see [class.cdtor]. Otherwise, such
66
+
// a glvalue refers to allocated storage ([basic.stc.dynamic.allocation]), and using
67
+
// the properties of the glvalue that do not depend on its value is well-defined.
68
+
// The program has undefined behavior if
69
+
// -- the glvalue is used to access the object, or
0 commit comments