Statement in boost lib, (void) p; what does it mean?

I came across the following code snippet in the Boost library for offset_ptr. under boost / interprocess / offset_ptr.hpp

typedef PointedType *                     pointer;
...
    //!Constructor from other pointer.
    //!Never throws.
    template <class T>
    offset_ptr(T *ptr) 
    {  pointer p (ptr);  (void)p; this->set_offset(p); }

I wonder what the statement (void) p does; does?

+5
source share
1 answer

One way to find out is to put a breakpoint on this line of code and go through to find out what it does. You can even reformat the code so that you can set a breakpoint in this particular expression (there is no law against editing these files - just do not change the actual code).

, pointer , set_offset, , , this->set_offset(p) p (void)p .

+1

All Articles