Created
August 24, 2022 21:25
-
-
Save KPB3rd/39f6cb1c267c9e47a1dae12d6490c669 to your computer and use it in GitHub Desktop.
Using constexpr in templated func
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| template <typename T> | |
| func() { | |
| if constexpr(std::is_same<T, TheTypeIWant>::value) { | |
| } | |
| else { | |
| } | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment