Delete default TimePoint constructor to detect error at compile time

pull/21996/head
Esun Kim 5 years ago
parent 96385e260f
commit 89908faede
  1. 10
      include/grpcpp/impl/codegen/time.h

@ -39,14 +39,8 @@ namespace grpc {
template <typename T>
class TimePoint {
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 <>

Loading…
Cancel
Save