C++ How do I convert a std::chrono::time_point to long and back

前端 未结 4 1612
深忆病人
深忆病人 2020-12-04 06:32

I need to convert std::chrono::time_point to and from a long type (integer 64 bits). I´m starting working with std::chrono ...

4条回答
  •  星月不相逢
    2020-12-04 07:19

    time_point objects only support arithmetic with other time_point or duration objects.

    You'll need to convert your long to a duration of specified units, then your code should work correctly.

提交回复
热议问题