New issue
Advanced search Search tips

Issue 648441 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2016
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Add << operator for base::UnguessableToken

Project Member Reported by tguilbert@chromium.org, Sep 19 2016

Issue description

The 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.



 
Description: Show this description
Project Member

Comment 2 by bugdroid1@chromium.org, 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

Project Member

Comment 3 by bugdroid1@chromium.org, 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

Status: Fixed (was: Started)

Sign in to add a comment