10

Why is <chrono> an unapproved header in the Google CPP Guide? I can't find any direct mention of this in the Google CPP Style Guide. This point mentions portability issues with <ratio> and <cfenv> but nothing about <chrono>.

paul-g
  • 3,797
  • 2
  • 21
  • 36

1 Answers1

9

According to C++11 use in Chromium The reason is

Duplicated Time APIs in base/. Keep using the base/ classes.

NathanOliver
  • 171,901
  • 28
  • 288
  • 402
  • Given that is the only answer, can you elaborate a bit more? – Mike W Feb 14 '20 at 13:30
  • @MikeW What more are you looking for? – NathanOliver Feb 14 '20 at 13:33
  • E.g. what is the exact issue with duplicating the API and what bugs can it creates with the libraries that use it. basically what is the big picture of using it? – Mike W Feb 14 '20 at 13:53
  • 4
    @MikeW The `` lib is banned in Google's Chromium project because Chromium features its own [Time API](https://chromium.googlesource.com/chromium/chromium/+/master/base/time.h), wich offers similar functionality. Since your situation is different, you could ignore this line by appending ` // NOLINT [build/c++11]`. – florisla Feb 19 '20 at 07:26