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

not_null and std::function #325

Closed
davidhunter22 opened this issue Aug 14, 2016 · 3 comments
Closed

not_null and std::function #325

davidhunter22 opened this issue Aug 14, 2016 · 3 comments
Assignees
Labels

Comments

@davidhunter22
Copy link

davidhunter22 commented Aug 14, 2016

Has there been any discussion of having a specialization of not_null for std::function. So
not_null<std::function<blah>>
would imply the std::function contains some non null function pointer.

Also has not_null been put for standardization?

@neilmacintosh neilmacintosh self-assigned this Sep 13, 2016
@neilmacintosh
Copy link
Collaborator

Hi @davidhunter22. There has been no previous talk of specializing for std::function, though it seems like a pretty reasonable idea at first glance....so consider it on the table for discussion!

We have not put together a proposal to standardize not_null yet. I think there are still some parts of the design that need refinement (see the issues on this repo for a quick summary of some) before it could be considered ready to take to WG21. Plus, my personal queue has been full with span and byte (GSL and guidelines are only supposed to be a small proportion of my work time).

With that said, I think once we get it a little more polished it should be one of the next types we try to standardize.

@xaxxon
Copy link
Contributor

xaxxon commented Apr 13, 2018

it seems that I have a PR already in that makes not_null work with std::function (if it didn't already). I added unit tests to check for std::function compatibility to my existing PR to make sure it continues to work. The syntax isn't the nicest not_null_std_function.get()(parameters, go, here); but it does work.

@JordanMaples
Copy link
Contributor

Maintainers' call: Sorry for the delay in replying to this issue. The design of not_null is for pointers to objects and for standard smart pointers, which do not support pointers to functions. For any changes to be made to not_null, an extension request for not_null needs to be made in the Core Guidelines. Thanks.

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

Successfully merging a pull request may close this issue.

4 participants