From Jason Turner
Watch on YouTube

Summary

This episode explores the capabilities and limitations of using std::optional and std::variant in constexpr contexts in C++17. Jason clarifies that while these algebraic data types can be used in constexpr contexts, they have some limitations: they cannot be reassigned within a constexpr context, although they can be constructed, accessed, and checked for values. The episode also identifies a potential implementation bug in GCC's standard library that incorrectly allows reassignment in constexpr contexts.

Resources

Tags