aligator
0.17.1
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
data.hpp
Go to the documentation of this file.
1
/*
2
Copyright 2023 Glen Joseph Fernandes
3
(glenjofe@gmail.com)
4
5
Distributed under the Boost Software License, Version 1.0.
6
(http://www.boost.org/LICENSE_1_0.txt)
7
*/
8
#ifndef BOOST_CORE_DATA_HPP
9
#define BOOST_CORE_DATA_HPP
10
11
#include <iterator>
12
13
// Note: MSVC doesn't define __cpp_lib_nonmember_container_access but supports
14
// the feature even in C++14 mode
15
#if (defined(__cpp_lib_nonmember_container_access) && \
16
(__cpp_lib_nonmember_container_access >= 201411l)) || \
17
(defined(_MSC_VER) && (_MSC_VER >= 1900))
18
19
namespace
boost {
20
using
std::data;
21
}
// namespace boost
22
23
#else
// (defined(__cpp_lib_nonmember_container_access) ...
24
25
#include <cstddef>
26
#include <initializer_list>
27
28
namespace
boost {
29
30
template
<
class
C>
31
inline
constexpr
auto
data(C &c)
noexcept
(
noexcept
(c.data()))
32
->
decltype
(c.data()) {
33
return
c.data();
34
}
35
36
template
<
class
C>
37
inline
constexpr
auto
data(
const
C &c)
noexcept
(
noexcept
(c.data()))
38
->
decltype
(c.data()) {
39
return
c.data();
40
}
41
42
template
<
class
T, std::
size_t
N>
inline
constexpr
T *data(T (&a)[N])
noexcept
{
43
return
a;
44
}
45
46
template
<
class
T>
47
inline
constexpr
const
T *data(std::initializer_list<T> l)
noexcept
{
48
return
l.begin();
49
}
50
51
}
// namespace boost
52
53
#endif
// (defined(__cpp_lib_nonmember_container_access) ...
54
55
#endif
include
aligator
third-party
boost
core
data.hpp
Generated by
1.13.2