14 #ifndef RANGES_V3_VIEW_SINGLE_HPP
15 #define RANGES_V3_VIEW_SINGLE_HPP
17 #include <type_traits>
27 #include <range/v3/utility/addressof.hpp>
30 #include <range/v3/utility/static_const.hpp>
33 #include <range/v3/detail/prologue.hpp>
43 CPP_assert(copy_constructible<T>);
44 static_assert(std::is_object<T>::value,
45 "The template parameter of single_view must be an object type");
46 semiregular_box_t<T> value_;
47 template<
typename... Args>
49 : value_{
static_cast<Args &&
>(args)...}
51 template<
typename... Args>
53 : value_{in_place,
static_cast<Args &&
>(args)...}
62 : value_(std::move(t))
64 template(
class... Args)(
65 requires constructible_from<T, Args...>)
69 static_cast<Args &&
>(args)...}
71 constexpr T * begin() noexcept
75 constexpr T
const * begin()
const noexcept
79 constexpr T * end() noexcept
83 constexpr T
const * end()
const noexcept
91 constexpr T * data() noexcept
93 return detail::addressof(
static_cast<T &
>(value_));
95 constexpr T
const * data()
const noexcept
97 return detail::addressof(
static_cast<T
const &
>(value_));
101 #if RANGES_CXX_DEDUCTION_GUIDES >= RANGES_CXX_DEDUCTION_GUIDES_17
111 template(
typename Val)(
112 requires copy_constructible<Val>)
128 using ranges::views::single;
130 template(
typename T)(
131 requires std::is_object<T>::value)
137 #include <range/v3/detail/epilogue.hpp>
138 #include <range/v3/detail/satisfy_boost_range.hpp>
RANGES_INLINE_VARIABLE(detail::to_container_fn< detail::from_range< std::vector >>, to_vector) template< template< typename... > class ContT > auto to(RANGES_HIDDEN_DETAIL(detail
For initializing a container of the specified type with the elements of an Range.
Definition: conversion.hpp:399
std::integral_constant< bool, B > bool_
An integral constant wrapper for bool.
Definition: meta.hpp:168
std::integral_constant< std::size_t, N > size_t
An integral constant wrapper for std::size_t.
Definition: meta.hpp:163
Definition: in_place.hpp:27
Definition: single.hpp:41
Definition: interface.hpp:129
Definition: single.hpp:110