Skip to content

Add RFC about C++20 modules support#2043

Open
isaevil wants to merge 4 commits intomasterfrom
rfc/isaevil/cxx20_modules
Open

Add RFC about C++20 modules support#2043
isaevil wants to merge 4 commits intomasterfrom
rfc/isaevil/cxx20_modules

Conversation

@isaevil
Copy link
Copy Markdown
Contributor

@isaevil isaevil commented Apr 2, 2026

Description

Add a comprehensive description of proposed changes

Fixes # - issue number(s) if exists

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
Comment thread rfcs/proposed/cxx20_modules/README.md Outdated
Comment thread rfcs/proposed/cxx20_modules/README.md Outdated
Comment thread rfcs/proposed/cxx20_modules/README.md Outdated
Comment thread rfcs/proposed/cxx20_modules/README.md Outdated
Comment thread rfcs/proposed/cxx20_modules/README.md Outdated
Comment thread rfcs/proposed/cxx20_modules/README.md Outdated

### CMake integration

The library must remain at C++11 as the minimum standard, hence the module source cannot be
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"must remain at C++11" is because of a project policy, not a technical reason. We may for example later, change to C++17 as the minimum standard as a policy change. As written, its unclear if you are stating a design constraint or a technical constraint.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added more details.

Comment thread rfcs/proposed/cxx20_modules/README.md Outdated
isaevil and others added 2 commits April 13, 2026 10:05
Co-authored-by: Mike Voss <michaelj.voss@intel.com>
Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
@isaevil isaevil requested a review from vossmjp April 15, 2026 11:21

## Proposal

### ABI non-breaking style with using-declaration
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also add a link to LLVM manual somewhere in this paragraph

that uses `import tbb;` instead of `#include`, or running the existing test suite
with module imports. Should whitebox tests be covered in the latter scenario?

6. How to provide preview functionality with modules? Should it be a separate `tbb.preview` module
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the important details about the preview features and feature-test macros are missed from the document.
For the preview feature, the only way to enable them is to compile the source with -DTBB_PREVIEW..., defining before import does not work.

For feature-test macros, they are simply not available from the module. Initially, they can be available by #include <tbb/version.h> header. Core functionality is available using import tbb.
We can consider providing exported functions replacing these macros in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the preview feature, the only way to enable them is to compile the source with -DTBB_PREVIEW...

That is what I meant by "should the tbb module be compiled with defined TBB_PREVIEW_* macros as needed?" in line below.

For feature-test macros, they are simply not available from the module. Initially, they can be available by #include <tbb/version.h> header. Core functionality is available using import tbb.
We can consider providing exported functions replacing these macros in the future.

I think I mostly cover this in 7th question. But I'll add a little more details as well as for question 6.

Signed-off-by: Isaev, Ilya <ilya.isaev@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants