Pointer Manipulation Functions
[STLSoft]


Detailed Description

These functions assist in calculations with, and the manipulation of, pointers.


Functions

template<typename T>
void const * ptr_byte_offset (T const p, ss_ptrdiff_t n)
 Offsets a pointer by a number of bytes.
template<typename T>
T const * ptr_offset (T const *p, ss_ptrdiff_t n)
 Offsets a pointer by a number of elements.
template<typename T1, typename T2>
ss_ptrdiff_t ptr_byte_diff (T1 const *p1, T2 const *p2)
 Get the difference in bytes between two pointers.
template<typename T1, typename T2>
ss_ptrdiff_t ptr_diff (T1 const *p1, T2 const *p2)
 Get the difference in elements between two pointers.


Function Documentation

ss_ptrdiff_t stlsoft::ptr_byte_diff ( T1 const *  p1,
T2 const *  p2 
) [inline]

Get the difference in bytes between two pointers.

void const* stlsoft::ptr_byte_offset ( T const   p,
ss_ptrdiff_t  n 
) [inline]

Offsets a pointer by a number of bytes.

Parameters:
p The pointer to be offset
n The number of bytes to offset
Returns:
p offset by bytes, expressed as void const*

References STLSOFT_ASSERT, and STLSOFT_SUPPRESS_UNUSED.

ss_ptrdiff_t stlsoft::ptr_diff ( T1 const *  p1,
T2 const *  p2 
) [inline]

Get the difference in elements between two pointers.

T const* stlsoft::ptr_offset ( T const *  p,
ss_ptrdiff_t  n 
) [inline]

Offsets a pointer by a number of elements.

Parameters:
p The pointer to be offset
n The number of elements to offset
Returns:
p offset by elements


Generated on Thu Jun 10 08:58:21 2010 for STLSoft by  doxygen 1.5.6