Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

Reference Section of Boost.Any

Header <boost/any.hpp>
Header <boost/any/bad_any_cast.hpp>
Header <boost/any/basic_any.hpp>
Header <boost/any/fwd.hpp>
Header <boost/any/unique_any.hpp>

Header <boost/any.hpp>

A class whose instances can hold instances of any type that satisfies ValueType requirements.

namespace boost {
  class any;
  void swap(any &, any &);
  template<typename ValueType> ValueType * any_cast(any *);
  template<typename ValueType> const ValueType * any_cast(const any *);
  template<typename ValueType> ValueType any_cast(any &);
  template<typename ValueType> ValueType any_cast(const any &);
  template<typename ValueType> ValueType any_cast(any &&);
}
namespace boost {
  class bad_any_cast;
}

A class with customizable Small Object Optimization whose instances can hold instances of any type that satisfies ValueType requirements. Use boost::any instead if not sure.

namespace boost {
  namespace anys {
    template<std::size_t OptimizeForSize, std::size_t OptimizeForAlignment> 
      class basic_any;
    template<std::size_t OptimizeForSize, std::size_t OptimizeForAlignment> 
      void swap(basic_any< OptimizeForSize, OptimizeForAlignment > &, 
                basic_any< OptimizeForSize, OptimizeForAlignment > &);
    template<typename ValueType, std::size_t Size, std::size_t Alignment> 
      ValueType * any_cast(basic_any< Size, Alignment > *);
    template<typename ValueType, std::size_t OptimizeForSize, 
             std::size_t OptimizeForAlignment> 
      const ValueType * 
      any_cast(const basic_any< OptimizeForSize, OptimizeForAlignment > *);
    template<typename ValueType, std::size_t OptimizeForSize, 
             std::size_t OptimizeForAlignment> 
      ValueType any_cast(basic_any< OptimizeForSize, OptimizeForAlignment > &);
    template<typename ValueType, std::size_t OptimizeForSize, 
             std::size_t OptimizeForAlignment> 
      ValueType any_cast(const basic_any< OptimizeForSize, OptimizeForAlignment > &);
    template<typename ValueType, std::size_t OptimizeForSize, 
             std::size_t OptimizeForAlignment> 
      ValueType any_cast(basic_any< OptimizeForSize, OptimizeForAlignment > &&);
  }
}

Forward declarations of Boost.Any library types.

A class whose instances can hold instances of any type (including non-copyable and non-movable types).

namespace boost {
  namespace anys {
    template<typename T> struct in_place_type_t;

    class unique_any;

    constexpr in_place_type_t< T > in_place_type;
    void swap(unique_any &, unique_any &);
    template<typename T> T * any_cast(unique_any *);
    template<typename T> const T * any_cast(const unique_any *);
    template<typename T> T any_cast(unique_any &);
    template<typename T> T any_cast(const unique_any &);
    template<typename T> T any_cast(unique_any &&);
  }
}

PrevUpHomeNext