sparrow
2.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Toggle main menu visibility
Loading...
Searching...
No Matches
layout_concept.hpp
Go to the documentation of this file.
1
// Copyright 2024 Man Group Operations Limited
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or mplied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#pragma once
16
17
#include <concepts>
18
19
#include "
sparrow/utils/nullable.hpp
"
20
21
namespace
sparrow
22
{
23
namespace
detail
24
{
25
template
<
class
T>
26
concept
layout_const_reference
=
is_nullable_v<T>
||
is_nullable_variant_v<T>
;
27
}
28
40
template
<
class
T>
41
concept
layout
=
requires
(
const
T& t) {
42
typename
T::inner_value_type;
43
typename
T::value_type;
44
typename
T::const_reference;
45
typename
T::size_type;
46
typename
T::const_iterator;
47
typename
T::const_reverse_iterator;
48
49
requires
detail::layout_const_reference<typename T::const_reference>
;
50
51
{ t[std::size_t()] } -> std::same_as<typename T::const_reference>;
52
{ t.size() } -> std::same_as<typename T::size_type>;
53
54
{ t.begin() } -> std::same_as<typename T::const_iterator>;
55
{ t.end() } -> std::same_as<typename T::const_iterator>;
56
{ t.cbegin() } -> std::same_as<typename T::const_iterator>;
57
{ t.cend() } -> std::same_as<typename T::const_iterator>;
58
{ t.rbegin() } -> std::same_as<typename T::const_reverse_iterator>;
59
{ t.rend() } -> std::same_as<typename T::const_reverse_iterator>;
60
{ t.crbegin() } -> std::same_as<typename T::const_reverse_iterator>;
61
{ t.crend() } -> std::same_as<typename T::const_reverse_iterator>;
62
};
63
}
sparrow::detail::layout_const_reference
Definition
layout_concept.hpp:26
sparrow::layout
Concept for layouts.
Definition
layout_concept.hpp:41
sparrow::detail
Definition
dynamic_bitset.hpp:391
sparrow
Definition
array.hpp:21
sparrow::is_nullable_variant_v
constexpr bool is_nullable_variant_v
Definition
nullable.hpp:1204
sparrow::is_nullable_v
constexpr bool is_nullable_v
Definition
nullable.hpp:62
nullable.hpp
sparrow
layout
layout_concept.hpp
Generated by
1.17.0