Skip to content

Use the _Transparent concept and remove _Is_transparent - #5498

Merged
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
frederick-vs-ja:transparent-concept
May 17, 2025
Merged

Use the _Transparent concept and remove _Is_transparent#5498
Stephan T. Lavavej (StephanTLavavej) merged 1 commit into
microsoft:mainfrom
frederick-vs-ja:transparent-concept

Conversation

@frederick-vs-ja

Copy link
Copy Markdown
Contributor

#3736 added _Is_transparent and _Transparent but didn't use them.

I think it's time to use the _Transparent concept for C++20-and-later-only code. And it seems less burdensome for compilers if _Is_transparent_v is changed to be implemented with a concept. After the changes, _Is_transparent_v will be only necessary for <xtree>, so this PR moves _Is_transparent_v to that header.

<flat_map> and <flat_set> will be changed in another PR.

Theoretically, _Is_transparent would be useful in the cases where conjunction(_v) or disjunction(_v) is used. But I think there won't be such a case in MSVC STL - for new code it's probably better to use requires-clauses, and the uses of _Is_transparent_v in <xtree> seem stable enough. So I decide to remove it.

@StephanTLavavej

Copy link
Copy Markdown
Member

I'm mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej
Stephan T. Lavavej (StephanTLavavej) merged commit c6c64d3 into microsoft:main May 17, 2025
@github-project-automation github-project-automation Bot moved this from Merging to Done in STL Code Reviews May 17, 2025
@StephanTLavavej

Copy link
Copy Markdown
Member

🪟 👓 🧊

@frederick-vs-ja
A. Jiang (frederick-vs-ja) deleted the transparent-concept branch May 18, 2025 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Something can be improved

2 participants