Procházet zdrojové kódy

Delete default TimePoint constructor to detect error at compile time

Esun Kim před 5 roky
rodič
revize
89908faede
1 změnil soubory, kde provedl 2 přidání a 8 odebrání
  1. 2 8
      include/grpcpp/impl/codegen/time.h

+ 2 - 8
include/grpcpp/impl/codegen/time.h

@@ -39,14 +39,8 @@ namespace grpc {
 template <typename T>
 template <typename T>
 class TimePoint {
 class TimePoint {
  public:
  public:
-  TimePoint(const T& /*time*/) { you_need_a_specialization_of_TimePoint(); }
-  gpr_timespec raw_time() {
-    gpr_timespec t;
-    return t;
-  }
-
- private:
-  void you_need_a_specialization_of_TimePoint();
+  TimePoint(const T& /*time*/) = delete;
+  gpr_timespec raw_time() = delete;
 };
 };
 
 
 template <>
 template <>