Skip to content

GH-50720: [C++] Replace std::is_same_v with std::same_as - #51460

Open
dkp116 wants to merge 1 commit into
apache:mainfrom
dkp116:GH-50720-update-same_v-to-cpp20
Open

dkp116 wants to merge 1 commit into
apache:mainfrom
dkp116:GH-50720-update-same_v-to-cpp20

Conversation

@dkp116

@dkp116 dkp116 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Upgrade to meet c++20 standards, looking at implementation of same_as on cppref this can be replace is_same_v
https://en.cppreference.com/cpp/concepts/same_as

What changes are included in this PR?

Replace std::is_same_v with std::same_as

Are these changes tested?

Ran testing library, no need to create new test case

Are there any user-facing changes?

No

Was AI used for this PR?

No

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • [ X] Human
  • AI

Reviewed before submission by:

  • [ X] Human
  • AI
  • Not reviewed

@taepper

taepper commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Did this change all usages of std::is_same_v in the codebase to std::same_as?

What is the rationale behind this? std::is_same_v is a type trait that evaluates to true or false, while std::same_as is a concept that is used define type constrains. Do you think it is advisable to e.g. replace this also in imperative code within template functions? If so, why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants