A concept-centered standard library for C++20, enabling safer and more reliable products and a more modern feel for C++ code.; Also home of Subdoc the code-documentation generator.
Legacy code often works with pointers, and we don't want to require applications to write int32_t in order to generate an int32_t* for a function call.
But also &i32var.primitive_value is out, we don't typically want to ever write .primitive_value.
So we should provide access to the primitive as a pointer. It can't be an implicit conversion, and we can't overload operator& (which is a bad idea anyway) because pointers to safe numerics are valid.
So we can mimic containers here and provide .as_ptr() and .as_mut_ptr() to give a pointer to the inner thing.
Legacy code often works with pointers, and we don't want to require applications to write
int32_t
in order to generate anint32_t*
for a function call.But also
&i32var.primitive_value
is out, we don't typically want to ever write.primitive_value
.So we should provide access to the primitive as a pointer. It can't be an implicit conversion, and we can't overload
operator&
(which is a bad idea anyway) because pointers to safe numerics are valid.So we can mimic containers here and provide
.as_ptr()
and.as_mut_ptr()
to give a pointer to the inner thing.