C++: Disable implicit conversion in specific contexts only

Open link in next tab

https://indii.org/blog/cplusplus-disable-implicit-conversion-in-specific-contexts/

C++ trick I pulled today. Like an explicit constructor but context dependent. Any alternatives from folks who've needed to do similar? One thing I still need to dig into a little deeper is how copy elision behaves here.