Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should not_null act like an alias #65

Closed
trebconnell opened this issue Sep 25, 2015 · 2 comments
Closed

Should not_null act like an alias #65

trebconnell opened this issue Sep 25, 2015 · 2 comments
Assignees
Labels

Comments

@trebconnell
Copy link
Contributor

Right now it's implemented like a smart pointer, with method like get(), but if I'm reading the isocpp guidelines correctly it should act like an alias. Given that it's under GSL.Views with owner and not GSL.Owner with the smart pointers.

template <class T> using not_null = T;

@trebconnell
Copy link
Contributor Author

The thinking behind the guideline being that you may want to use these types on an ABI interface. Having them be a class at all would prohibit this. Is the plan to replace the dbg checking of these types with the static analysis and change them into aliases in the long-term?

@neilmacintosh neilmacintosh self-assigned this Sep 25, 2015
@gdr-at-ms
Copy link
Member

We actually want not_null to be a distinct type. It has an invariant deterministically expressible and cheap to enforce.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants