Summary
Jason Turner explores C++20's new conditionally explicit specifier, which allows constructors and conversion operators to be explicitly marked based on a compile-time condition. He demonstrates how this feature can improve type safety by making potentially expensive conversions explicit while allowing implicit conversions for trivial, inexpensive types. The episode shows practical examples with a templated wrapper class, illustrating how to create type-dependent conversion behaviors without duplicating code.
Related C++ Standard Sections
This episode covers topics found in these sections of the C++ standard:
-
[class.conv]74% match -
[conv]73% match -
[diff.cpp17.class]53% match -
[diff.cpp03.expr]52% match -
[expr.type.conv]49% match -
[optional]40% match