Skip to content

Add RFC about C++20 modules support#2043

Open
isaevil wants to merge 1 commit intomasterfrom
rfc/isaevil/cxx20_modules
Open

Add RFC about C++20 modules support#2043
isaevil wants to merge 1 commit 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>
The proposed approach has several advantages over other alternatives:

- It does not require the modification of existing headers, as the module includes them as
part of global module fragment and then selectively export the necessary `using`
Copy link
Copy Markdown
Contributor

@vossmjp vossmjp Apr 2, 2026

Choose a reason for hiding this comment

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

Suggested change
part of global module fragment and then selectively export the necessary `using`
part of a global module fragment and then selectively exports the necessary `using`


- It does not require the modification of existing headers, as the module includes them as
part of global module fragment and then selectively export the necessary `using`
declarations. Thus, the development can continue in headers.
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.

Suggested change
declarations. Thus, the development can continue in headers.
declarations. Thus, development can continue in headers.

- It does not require the modification of existing headers, as the module includes them as
part of global module fragment and then selectively export the necessary `using`
declarations. Thus, the development can continue in headers.
- Since the API is declared as part of global module fragment, the name of the module will
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.

Suggested change
- Since the API is declared as part of global module fragment, the name of the module will
- Since the API is declared as part of a global module fragment, the name of the module will

part of global module fragment and then selectively export the necessary `using`
declarations. Thus, the development can continue in headers.
- Since the API is declared as part of global module fragment, the name of the module will
not participate in the name mangling, making translation units compiled with modules,
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.

Suggested change
not participate in the name mangling, making translation units compiled with modules,
not participate in name mangling, making translation units compiled with modules,

not participate in the name mangling, making translation units compiled with modules,
compatible with the units compiled with regular headers.

The disadvantage of this approach is an obligation to update the module interface unit each time new API is added.
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.

Suggested change
The disadvantage of this approach is an obligation to update the module interface unit each time new API is added.
The disadvantage of this approach is an obligation to update the module interface unit each time a new API is added.


### 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.


The library must remain at C++11 as the minimum standard, hence the module source cannot be
compiled as part of the oneTBB build. Additionally, currently the built module constrains
the consumer to use the specific version of the C++ standard: the one that was used during
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.

Suggested change
the consumer to use the specific version of the C++ standard: the one that was used during
the consumer to use a specific version of the C++ standard: the one that was used during

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.

2 participants