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 to view this page for the latest version.
PrevUpHomeNext

Class cast_source

boost::log::attributes::cast_source

Synopsis

// In header: <boost/log/attributes/attribute_cast.hpp>


class cast_source {
public:
  // construct/copy/destruct
  explicit cast_source(attribute::impl *);

  // public member functions
  template<typename T> T * as() const;
};

Description

The class holds a reference to the attribute factory implementation being casted

cast_source public construct/copy/destruct

  1. explicit cast_source(attribute::impl * p);

    Initializing constructor. Creates a source that refers to the specified factory implementation.

cast_source public member functions

  1. template<typename T> T * as() const;

    The function attempts to cast the aggregated pointer to the implementation to the specified type.

    Returns:

    The converted pointer or NULL, if the conversion fails.


PrevUpHomeNext