Skip to content
Snippets Groups Projects
Commit 2fc23831 authored by Chaoran Yang's avatar Chaoran Yang
Browse files

Use std::addressof to instead of plain '&'.

Otherwise the code won't compile if the '&' operater is overloaded and
return something that cannot be casted to void *.
parent 52998153
No related branches found
No related tags found
No related merge requests found
......@@ -152,8 +152,8 @@ class TypeWithoutFormatter {
// This default version is called when kTypeKind is kOtherType.
static void PrintValue(const T& value, ::std::ostream* os) {
PrintBytesInObjectTo(static_cast<const unsigned char*>(
reinterpret_cast<const void*>(&value)),
sizeof(value), os);
reinterpret_cast<const void*>(
std::addressof(value))), sizeof(value), os);
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment