[libcxx-commits] [PATCH] D60480: [libc++] Integrate the PSTL into libc++

Duncan P. N. Exon Smith via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jun 25 13:44:58 PDT 2019


dexonsmith added a subscriber: bruno.
dexonsmith added inline comments.


================
Comment at: libcxx/include/algorithm:5790
+// otherwise just pull in forward declarations.
+#include <pstl/internal/pstl_config.h>
+#if defined(__PSTL_EXECUTION_POLICIES_DEFINED)
----------------
ldionne wrote:
> EricWF wrote:
> > ldionne wrote:
> > > The same pattern is repeated in other files. Basically, we check whether `<execution>` has been included, and if so, then we provide all the definitions. Otherwise, we just provide forward declarations to avoid the compile-time overhead if you just `#include <algorithm>` but don't care about the parallel algorithms.
> > > 
> > I really really really dislike this pattern. We shouldn't do it.
> > I don't think this is how you should structure a library.
> > 
> > Are there other alternatives?
> I dislike it too. The only alternative I can think of is to unconditionally include the definitions, however this may impose a compile-time hit on everyone that's not using the parallel algorithms.
@bruno, will this pattern cause a problem for Clang modules (esp. with local submodule visibility)?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60480





More information about the libcxx-commits mailing list