mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Roll forward to cl/318180324
Signed-off-by: Alexey Polyudov <apolyudov@google.com> Change-Id: I71bb49fe74104964088d392b12775ec2a253b1c9
This commit is contained in:
@@ -19,7 +19,8 @@ namespace nearby {
|
||||
template <typename Derived, typename Base>
|
||||
inline Derived down_cast(Base* value) {
|
||||
using DerivedType = typename std::remove_pointer<Derived>::type;
|
||||
static_assert(std::is_base_of<Base, DerivedType>::value);
|
||||
static_assert(std::is_base_of<Base, DerivedType>::value,
|
||||
"incompatible casting");
|
||||
return static_cast<Derived>(value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user