]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/ipc/mem/FlexibleArray.h
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / ipc / mem / FlexibleArray.h
index 0af9971f06e903aa4515f4cafacd9e94fa293a9d..2b6a6c50815f9b42da1a89a08b9411c49155bbe3 100644 (file)
@@ -1,11 +1,16 @@
 /*
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
  */
 
 #ifndef SQUID_IPC_MEM_FLEXIBLE_ARRAY_H
 #define SQUID_IPC_MEM_FLEXIBLE_ARRAY_H
 
 // sometimes required for placement-new operator to be declared
-#include <new> 
+#include <new>
 
 namespace Ipc
 {
@@ -23,7 +28,7 @@ class FlexibleArray
 public:
     explicit FlexibleArray(const int capacity) {
         if (capacity > 1) // the first item is initialized automatically
-            new (items+1) Item[capacity-1];
+            new (raw()+1) Item[capacity-1];
     }
 
     Item &operator [](const int idx) { return items[idx]; }
@@ -43,3 +48,4 @@ private:
 } // namespace Ipc
 
 #endif /* SQUID_IPC_MEM_FLEXIBLE_ARRAY_H */
+