Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Struct template pointer_plus_2_bits<T *>

boost::intrusive::pointer_plus_2_bits<T *>

Synopsis

template<typename T> 
struct pointer_plus_2_bits<T *> {
  // types
  typedef T * pointer;

  // public static functions
  static pointer get_pointer(pointer) ;
  static void set_pointer(pointer &, pointer) ;
  static std::size_t get_bits(pointer) ;
  static void set_bits(pointer &, std::size_t) ;
};

Description

This is the specialization to embed 2 extra bits of information in a raw pointer. Extra bits are stored in the lower bits of the pointer.

pointer_plus_2_bits public static functions

  1. static pointer get_pointer(pointer n) ;
  2. static void set_pointer(pointer & n, pointer p) ;
  3. static std::size_t get_bits(pointer n) ;
  4. static void set_bits(pointer & n, std::size_t c) ;

PrevUpHomeNext