Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of deprecated C++ features #8

Open
s9w opened this issue Jul 19, 2021 · 2 comments
Open

Use of deprecated C++ features #8

s9w opened this issue Jul 19, 2021 · 2 comments

Comments

@s9w
Copy link

s9w commented Jul 19, 2021

Hi - this is pretty cool! But it uses std::is_literal_type, which is deprecated in C++17 and removed in C++20 - which makes this unusable in the majority of codebases I would assume. Any plan to address this?

@jesperkdab
Copy link

This is cool indeed, but I share s9w's concern about using the deprecated constructs. I've just added this to my project, and realizes that without a fix to this I'll be locked in to C++17.
Mind sharing your thoughts on an upgrade

dangelog added a commit to dangelog/strong_typedef that referenced this issue Dec 29, 2021
The type trait has been deprecated in C++17 and removed in C++20
because it offers no help in generic programming.

Its usage is not needed in strong_typedef, where it was used to SFINAE
out specializations that were otherwise identical to the primary
template, except that they declared constexpr functions instead of
non-constexpr. But this is unnecessary: a function template can always
be marked as constexpr, the compiler will simply "ignore" it [1] if a
given instantation cannot actually be constexpr.

Hence just leave the constexpr code, drop the specializations and the
related SFINAE.

[1] https://eel.is/c++draft/dcl.constexpr#7.sentence-1

Fixes anthonywilliams#8
@dfaure-kdab
Copy link

dfaure-kdab commented Feb 10, 2022

Thanks @dangelog for the fix!

@anthonywilliams could you review #11? Thanks.

monwarez pushed a commit to monwarez/strong_typedef that referenced this issue Apr 1, 2022
The type trait has been deprecated in C++17 and removed in C++20
because it offers no help in generic programming.

Its usage is not needed in strong_typedef, where it was used to SFINAE
out specializations that were otherwise identical to the primary
template, except that they declared constexpr functions instead of
non-constexpr. But this is unnecessary: a function template can always
be marked as constexpr, the compiler will simply "ignore" it [1] if a
given instantation cannot actually be constexpr.

Hence just leave the constexpr code, drop the specializations and the
related SFINAE.

[1] https://eel.is/c++draft/dcl.constexpr#7.sentence-1

Fixes anthonywilliams#8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants