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.
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user