Uploaded April 2024 | Updated November 2026, 14 hours ago
In this video, the real superpower of C++ is demonstrated. It is in response to some comments on youtube.com/watch?v=fsIfQqRjc1U.
constexpr C++ Solution: godbolt.org/z/e3j63c3b6
Maximum Prime Difference: leetcode.com/problems/maximum-prime-difference/description
Chapters:
0:00 Intro
0:46 YouTube Comment on constexpr
1:52 Refactor: std::ranges::contains
2:10 Refactor: namespace stdr
2:59 Show constexpr is_prime
3:57 Original code (~4000 LOA - lines of assembly)
4:00 Remove std::println (129 LOA)
4:33 constexpr maximum_prime_difference (129 LOA)
5:03 Remove std::vector (113 LOA)
5:32 Diagnose using consteval
6:14 constexpr vec variable (3 LOA)
7:14 Outro
Follow me on GitHub: github.com/codereport
Follow me on Twitter: twitter.com/code_report
Follow me on LinkedIn: linkedin.com/company/codereport
In this video, the real superpower of C++ is demonstrated. It is in response to some comments on youtube.com/watch?v=fsIfQqRjc1U.
constexpr C++ Solution: godbolt.org/z/e3j63c3b6
Maximum Prime Difference: leetcode.com/problems/maximum-prime-difference/description
Chapters:
0:00 Intro
0:46 YouTube Comment on constexpr
1:52 Refactor: std::ranges::contains
2:10 Refactor: namespace stdr
2:59 Show constexpr is_prime
3:57 Original code (~4000 LOA - lines of assembly)
4:00 Remove std::println (129 LOA)
4:33 constexpr maximum_prime_difference (129 LOA)
5:03 Remove std::vector (113 LOA)
5:32 Diagnose using consteval
6:14 constexpr vec variable (3 LOA)
7:14 Outro
Follow me on GitHub: github.com/codereport
Follow me on Twitter: twitter.com/code_report
Follow me on LinkedIn: linkedin.com/company/codereport










