STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - Template Software for the Active Template Library COMSTL - The Standard Template Library meets the Component Object Model .netSTL - Standard Template Library meets the Microsoft.NET Common Language Runtime InetSTL - The Standard Template Library meets WinInet MFCSTL - Template Software for the Microsoft Foundation Classes UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Pointer Manipulation Functions
[STLSoft]

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

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.


Detailed Description

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


Function Documentation

ss_ptrdiff_t ptr_byte_diff T1 const *    p1,
T2 const *    p2
[inline]
 

Get the difference in bytes between two pointers.

void const* 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

ss_ptrdiff_t ptr_diff T1 const *    p1,
T2 const *    p2
[inline]
 

Get the difference in elements between two pointers.

T const* 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

STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004