[interprocess] operator>> for offset_ptr

Hello, offset_ptr.hpp:291 contains the following code for operator>>: template<class E, class T, class Y> inline std::basic_istream<E, T> & operator>> (std::basic_istream<E, T> & os, offset_ptr<Y> & p) { Y * tmp; return os >> tmp; p = tmp; } The last assignment is never executed as there is a return statement before it. This smells fishy. Regards, Markus

Markus Schöpflin escribió:
Hello,
offset_ptr.hpp:291 contains the following code for operator>>:
template<class E, class T, class Y> inline std::basic_istream<E, T> & operator>> (std::basic_istream<E, T> & os, offset_ptr<Y> & p) { Y * tmp; return os >> tmp; p = tmp; }
The last assignment is never executed as there is a return statement before it. This smells fishy.
You are right. Changed with: { return os >> p.get(); }
Regards, Markus
Ion
participants (2)
-
Ion Gaztañaga
-
Markus Schöpflin