sparrow
2.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Toggle main menu visibility
Loading...
Searching...
No Matches
pair.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 implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
#pragma once
16
17
#include <utility>
18
19
#if defined(__cpp_lib_format)
20
# include <format>
21
# include <ostream>
22
#endif
23
24
#if defined(__cpp_lib_format) && __cplusplus < 202300L
25
26
template
<
typename
T,
typename
U>
27
struct
std::formatter<
std
::pair<T, U>>
28
{
29
constexpr
auto
parse(std::format_parse_context& ctx)
30
{
31
return
ctx.begin();
32
}
33
34
auto
format(
const
std::pair<T, U>& p, std::format_context& ctx)
const
35
{
36
return
std::format_to(ctx.out(),
"({}, {})"
, p.first, p.second);
37
}
38
};
39
40
template
<
typename
T,
typename
U>
41
std::ostream&
operator<<
(std::ostream& os,
const
std::pair<T, U>& value)
42
{
43
os << std::format(
"{}"
, value);
44
return
os;
45
}
46
47
#endif
operator<<
std::ostream & operator<<(std::ostream &stream, primesum::uint128_t n)
The __int128_t type (GCC/Clang) is not well supported by the C++ standard library (in 2016) so we hav...
Definition
int128_t.hpp:48
std
Extensions to the C++ standard library.
Definition
float16_t.hpp:1916
sparrow
utils
pair.hpp
Generated by
1.17.0