[libcxx-commits] [PATCH] D60537: [pstl] Do not inject execution policies into namespace ::pstl in the tests

Mikhail Dvorskiy via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 11 02:13:00 PDT 2019


MikeDvorskiy added a comment.

Guys,
I understand that given pstl code is becoming a part  of C++ standard library and , of course should be **std::**execution::unsequenced_policy and so on..

But, there is PSTL standalone version, which works with the other  compilers and environment , MSVC for example, where there is another implementation of Parallel STL.
In that case we have to differ a namespace where the execution are defined, otherwise a user code (and the tests) will use MSVC implementation of parallel algorithms instead of our...

I have two alternative ideas here:

1. Using a special macro like

> __PSTL_NAMESPACE_FOR_EXECUTION

On LLVM side it will be  defined as

  #define __PSTL_NAMESPACE_FOR_EXECUTION std

On our side it will be defined as

  #define __PSTL_NAMESPACE_FOR_EXECUTION __pstl



2. Or just use

> using namespace std;

or (depends on a macro like PSTL_POLICY_USAGE)

> using namespace __pstl;

in test\support\pstl_test_config.h or test\support\utils.h


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60537





More information about the libcxx-commits mailing list