Merge pull request #21996 from veblush/deadline-catch

Delete default TimePoint constructor to detect error at compile time
pull/21967/head
Esun Kim 5 years ago committed by GitHub
commit aa666f4b76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      include/grpcpp/impl/codegen/time.h

@ -39,14 +39,12 @@ namespace grpc {
template <typename T> template <typename T>
class TimePoint { class TimePoint {
public: public:
TimePoint(const T& /*time*/) { you_need_a_specialization_of_TimePoint(); } // If you see the error with methods below, you may need either
gpr_timespec raw_time() { // i) using the existing types having a conversion class such as
gpr_timespec t; // gpr_timespec and std::chrono::system_clock::time_point or
return t; // ii) writing a new TimePoint<YourType> to address your case.
} TimePoint(const T& /*time*/) = delete;
gpr_timespec raw_time() = delete;
private:
void you_need_a_specialization_of_TimePoint();
}; };
template <> template <>

Loading…
Cancel
Save