> On March 30, 2016, 3:03 p.m., Benjamin Bannier wrote: > > 3rdparty/libprocess/src/process.cpp, line 1531 > > <https://reviews.apache.org/r/45489/diff/1/?file=1319590#file1319590line1531> > > > > Here and below: Either explicitly assert that the `dynamic_cast` does > > not return `NULL`, or use `static_cast`. > > > > Since `Encoder` seems to implement its own idea of polymorphism it > > seems `static_cast` might fit better.
Hmmm -- I thought `static_cast` was only safe for downcasts when the parent class is non-virtual? - Neil ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/45489/#review126115 ----------------------------------------------------------- On March 30, 2016, 2:49 p.m., Neil Conway wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/45489/ > ----------------------------------------------------------- > > (Updated March 30, 2016, 2:49 p.m.) > > > Review request for mesos and Ben Mahler. > > > Repository: mesos > > > Description > ------- > > Casting from a parent class to a child class should not > be done with reinterpret_cast. > > > Diffs > ----- > > 3rdparty/libprocess/src/process.cpp > feaffa4334422ec3964f8d079f570061eaf390d2 > > Diff: https://reviews.apache.org/r/45489/diff/ > > > Testing > ------- > > make check > > > Thanks, > > Neil Conway > >