File indexing completed on 2025-01-18 09:30:29
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_CORE_DATA_HPP
0009 #define BOOST_CORE_DATA_HPP
0010
0011 #include <initializer_list>
0012 #include <cstddef>
0013
0014 namespace boost {
0015
0016 template<class C>
0017 inline constexpr auto
0018 data(C& c) noexcept(noexcept(c.data())) -> decltype(c.data())
0019 {
0020 return c.data();
0021 }
0022
0023 template<class C>
0024 inline constexpr auto
0025 data(const C& c) noexcept(noexcept(c.data())) -> decltype(c.data())
0026 {
0027 return c.data();
0028 }
0029
0030 template<class T, std::size_t N>
0031 inline constexpr T*
0032 data(T(&a)[N]) noexcept
0033 {
0034 return a;
0035 }
0036
0037 template<class T>
0038 inline constexpr const T*
0039 data(std::initializer_list<T> l) noexcept
0040 {
0041 return l.begin();
0042 }
0043
0044 }
0045
0046 #endif