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 a snapshot of the develop branch, built from commit aaa128e8f8.
PrevUpHomeNext

data

Overview
Reference

Authors

  • Glen Fernandes

The header <boost/core/data.hpp> provides function templates data to obtain the pointer to the first element in a range.

namespace boost {

template<class C>
constexpr auto
data(C& c) noexcept(noexcept(c.data())) -> decltype(c.data());

template<class C>
constexpr auto
data(const C& c) noexcept(noexcept(c.data())) -> decltype(c.data());

template<class T, std::size_t N>
constexpr T*
data(T(&a)[N]) noexcept;

template<class T>
constexpr const T*
data(std::initializer_list<T> l) noexcept;

} /* boost */

template<class C> constexpr auto data(C& c) noexcept(noexcept(c.data())) -> decltype(c.data());

Returns c.data().

template<class C> constexpr auto data(const C& c) noexcept(noexcept(c.data())) -> decltype(c.data());

Returns c.data().

template<class T, std::size_t N> constexpr T* data(T(&a)[N]) noexcept;

Returns a.

template<class T> constexpr const T* data(std::initializer_list<T> l) noexcept;

Returns l.begin().


PrevUpHomeNext