Not a constructor because it does something else from the other constructors (allocates new memory instead of wrapping existing memory), and also because nullptr for the first argument be ambiguous. The latter could be solved with an explicit nullptr_t overload, though. The elements of the array are initialized with value initialization. For primitive types, like int and pointers, this means the
| 68 | // primitive types, like int and pointers, this means the elements will be set |
| 69 | // to the equivalent of 0 (or false or nullptr). |
| 70 | static Bounds_checked_array Alloc(MEM_ROOT *mem_root, size_t size) { |
| 71 | return {mem_root->ArrayAlloc<Element_type>(size), size}; |
| 72 | } |
| 73 | |
| 74 | /// Make a copy of '*this'. Allocate memory for m_array on 'mem_root'. |
| 75 | Bounds_checked_array Clone(MEM_ROOT *mem_root) const { |
no outgoing calls