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

Need a polymorphic NULL pointer that can be used in function templates #48

Closed
GoogleCodeExporter opened this issue Jul 15, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

C++ often requires you to explicitly cast NULL to a specific type when it
is used to invoke a function template, which is tedious.  We can add the
following class:

class Null {
 public:
  template <typename T>
  operator T*() const { return NULL; }
};

Then the user should be able to write Null() wherever a NULL pointer is
expected, even when invoking a templatized function.

Original issue reported on code.google.com by shiq...@gmail.com on 8 Oct 2008 at 9:35

@GoogleCodeExporter
Copy link
Author

This doesn't seem to belong to gtest.

Original comment by zhanyong...@gmail.com on 22 Feb 2009 at 5:47

  • Changed state: WontFix

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

No branches or pull requests

1 participant