Add << operator for base::UnguessableToken |
||
Issue descriptionThe C++ style guide recommends: "Overload << as a streaming operator for your type only if your type represents a value, and << writes out a human-readable string representation of that value." (https://google.github.io/styleguide/cppguide.html#Streams) I believe UnguessableToken meets this criterion, and that the << should be overloaded to use the the ToString() as syntactic sugar.
,
Sep 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/13be8a310b844140227c0c9f1f54991478bef8d2 commit 13be8a310b844140227c0c9f1f54991478bef8d2 Author: tguilbert <tguilbert@chromium.org> Date: Tue Sep 20 02:04:50 2016 Add base::UnguessableToken << operator base::UnguessableToken seems to fit the Google C++ style guide's criterion on overloading << as a streaming operator. Notably: -- It represents a value. -- There is an easy human-readable string reprensetation of the value (0 padded HEX). This change adds an overload to the << operator, as syntactic sugar. BUG= 648441 TEST= Modified a UT to test the operator. Review-Url: https://codereview.chromium.org/2353663003 Cr-Commit-Position: refs/heads/master@{#419647} [modify] https://crrev.com/13be8a310b844140227c0c9f1f54991478bef8d2/base/unguessable_token.cc [modify] https://crrev.com/13be8a310b844140227c0c9f1f54991478bef8d2/base/unguessable_token.h [modify] https://crrev.com/13be8a310b844140227c0c9f1f54991478bef8d2/base/unguessable_token_unittest.cc
,
Sep 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/13be8a310b844140227c0c9f1f54991478bef8d2 commit 13be8a310b844140227c0c9f1f54991478bef8d2 Author: tguilbert <tguilbert@chromium.org> Date: Tue Sep 20 02:04:50 2016 Add base::UnguessableToken << operator base::UnguessableToken seems to fit the Google C++ style guide's criterion on overloading << as a streaming operator. Notably: -- It represents a value. -- There is an easy human-readable string reprensetation of the value (0 padded HEX). This change adds an overload to the << operator, as syntactic sugar. BUG= 648441 TEST= Modified a UT to test the operator. Review-Url: https://codereview.chromium.org/2353663003 Cr-Commit-Position: refs/heads/master@{#419647} [modify] https://crrev.com/13be8a310b844140227c0c9f1f54991478bef8d2/base/unguessable_token.cc [modify] https://crrev.com/13be8a310b844140227c0c9f1f54991478bef8d2/base/unguessable_token.h [modify] https://crrev.com/13be8a310b844140227c0c9f1f54991478bef8d2/base/unguessable_token_unittest.cc
,
Sep 20 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by tguilbert@chromium.org
, Sep 19 2016