aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2016-06-15 10:57:50 -0700
committerGravatar Vijay Pai <vpai@google.com>2016-06-15 10:57:50 -0700
commit06ea541ed955e931668a032fc5d9ac096d37e088 (patch)
treecc3412e06eb94a1fa942118ad750acffdef3c7fc /include
parent9aa5f23645b624f22ef66150600bd1772c8d2654 (diff)
Provide nullptr->std::function cast
Diffstat (limited to 'include')
-rw-r--r--include/grpc++/impl/codegen/config.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/grpc++/impl/codegen/config.h b/include/grpc++/impl/codegen/config.h
index d782d5f571..cf88efa1d1 100644
--- a/include/grpc++/impl/codegen/config.h
+++ b/include/grpc++/impl/codegen/config.h
@@ -78,6 +78,7 @@
#endif
#ifdef GRPC_CXX0X_NO_NULLPTR
+#include <functional>
#include <memory>
namespace grpc {
const class {
@@ -95,6 +96,10 @@ const class {
return std::shared_ptr<T>(static_cast<T *>(0));
}
operator bool() const { return false; }
+ template <class F>
+ operator std::function<F>() const {
+ return std::function<F>();
+ }
private:
void operator&() const = delete;