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 *.
This commit is contained in:
parent
5299815377
commit
2fc2383165
|
@ -152,8 +152,8 @@ class TypeWithoutFormatter {
|
||||||
// This default version is called when kTypeKind is kOtherType.
|
// This default version is called when kTypeKind is kOtherType.
|
||||||
static void PrintValue(const T& value, ::std::ostream* os) {
|
static void PrintValue(const T& value, ::std::ostream* os) {
|
||||||
PrintBytesInObjectTo(static_cast<const unsigned char*>(
|
PrintBytesInObjectTo(static_cast<const unsigned char*>(
|
||||||
reinterpret_cast<const void*>(&value)),
|
reinterpret_cast<const void*>(
|
||||||
sizeof(value), os);
|
std::addressof(value))), sizeof(value), os);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user