소스 검색

Provide nullptr->std::function cast

Vijay Pai 9 년 전
부모
커밋
06ea541ed9
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      include/grpc++/impl/codegen/config.h

+ 5 - 0
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;