Search code examples
dtemplate-meta-programming

Is there some kind of NotNull<T> (in C++ terms) in phobos?


Does D's standard library contain some kind of pointer/smart pointer wrapper like not_null from the C++ core guidelines? Or maybe there is a well-known implementation?


Solution

  • Not in the standard library, no. There's a Dub package for it, and it's been discussed numerous times on the forum.