[libcxx-commits] [PATCH] D139231: [libc++] Move the definition of aligned allocation helpers outside of <new>

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 27 09:22:43 PST 2023


Mordante added inline comments.


================
Comment at: libcxx/include/__memory/aligned_alloc.h:10
+#ifndef _LIBCPP___MEMORY_ALIGNED_ALLOC_H
+#define _LIBCPP___MEMORY_ALIGNED_ALLOC_H
+
----------------
ldionne wrote:
> Mordante wrote:
> > Why is the header not included by `__memory`? When intended it would be good to document why it's the case.
> > Then the guarded include in the `.cpp` files can be removed too.
> Like we do for many other implementation-detail headers, we don't include them in the main public header unless they provide something that is part of the public. We actually have the opposite policy (to include everything, as you mention), but we do it very inconsistently, sometimes because it's literally impossible to do otherwise. Hence, I think we should shift the policy towards including only the things that are necessary for the public API.
I think it would be good to document our policy. I sometimes get the impression different developers have different ideas what the policies are.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D139231/new/

https://reviews.llvm.org/D139231



More information about the libcxx-commits mailing list