mirror of
https://github.com/chromium/crashpad.git
synced 2024-12-31 01:43:03 +08:00
48b1964d1b
implicit_cast<> only performs a cast in cases where an implicit conversion would be possible. It’s even safer than static_cast<> It’s an “explicit implicit” cast, which is not normally necsesary, but is frequently required when working with the ?: operator, functions like std::min() and std::max(), and logging and testing macros. The public style guide does not mention implicit_cast<> only because it is not part of the standard library, but would otherwise require it in these situations. Since base does provide implicit_cast<>, it should be used whenever possible. The only uses of static_cast<> not converted to implicit_cast<> are those that require static_cast<>, such as those that assign an integer constant to a variable of an enum type. R=rsesek@chromium.org Review URL: https://codereview.chromium.org/700383007