aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
data.hpp
Go to the documentation of this file.
1/*
2Copyright 2023 Glen Joseph Fernandes
3(glenjofe@gmail.com)
4
5Distributed 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 <initializer_list>
12#include <cstddef>
13
14namespace boost {
15
16template<class C>
17inline constexpr auto
18data(C& c) noexcept(noexcept(c.data())) -> decltype(c.data())
19{
20 return c.data();
21}
22
23template<class C>
24inline constexpr auto
25data(const C& c) noexcept(noexcept(c.data())) -> decltype(c.data())
26{
27 return c.data();
28}
29
30template<class T, std::size_t N>
31inline constexpr T*
32data(T(&a)[N]) noexcept
33{
34 return a;
35}
36
37template<class T>
38inline constexpr const T*
39data(std::initializer_list<T> l) noexcept
40{
41 return l.begin();
42}
43
44} /* boost */
45
46#endif
Definition data.hpp:14
constexpr auto data(C &c) noexcept(noexcept(c.data())) -> decltype(c.data())
Definition data.hpp:18