aligator 0.17.1
A versatile and efficient C++ library for real-time constrained trajectory optimization.
Loading...
Searching...
No Matches
make_span.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_MAKE_SPAN_HPP
9#define BOOST_CORE_MAKE_SPAN_HPP
10
12
13namespace boost {
14
15template <class I>
16inline constexpr span<I> make_span(I *f, std::size_t c) noexcept {
17 return span<I>(f, c);
18}
19
20template <class I> inline constexpr span<I> make_span(I *f, I *l) noexcept {
21 return span<I>(f, l);
22}
23
24template <class T, std::size_t N>
25inline constexpr span<T, N> make_span(T (&a)[N]) noexcept {
26 return span<T, N>(a);
27}
28
29template <class T, std::size_t N>
30inline constexpr span<T, N> make_span(std::array<T, N> &a) noexcept {
31 return span<T, N>(a);
32}
33
34template <class T, std::size_t N>
35inline constexpr span<const T, N>
36make_span(const std::array<T, N> &a) noexcept {
37 return span<const T, N>(a);
38}
39
40template <class R>
41inline span<typename detail::span_data<R>::type> make_span(R &&r) {
42 return span<typename detail::span_data<R>::type>(std::forward<R>(r));
43}
44
45} // namespace boost
46
47#endif