|
|
template<typename T, T... N> |
| using | fmt::detail::integer_sequence = std::integer_sequence<T, N...> |
|
template<size_t... N> |
| using | fmt::detail::index_sequence = std::index_sequence<N...> |
|
template<size_t N> |
| using | fmt::detail::make_index_sequence = std::make_index_sequence<N> |
| template<typename T> |
| using | fmt::detail::TupleIndexSequence |
|
template<typename Char, typename... T> |
| using | fmt::detail::tuple::result_t = std::tuple<Formatter<remove_cvref_t<T>, Char>...> |
| template<typename Range> |
| using | fmt::detail::RangeReferenceType |
|
template<typename Range> |
| using | fmt::detail::UncvrefType = remove_cvref_t<RangeReferenceType<Range>> |
|
template<RangeFormat K> |
| using | fmt::detail::RangeFormatConstant = std::integral_constant<RangeFormat, K> |
|
template<typename Char, typename Element> |
| using | fmt::detail::RangeFormatterType = Formatter<remove_cvref_t<Element>, Char> |
| template<typename R> |
| using | fmt::detail::MaybeConstRange |
|
|
template<typename T, size_t N> |
| auto | fmt::detail::rangeBegin (const T(&arr)[N]) -> const T * |
|
template<typename T, size_t N> |
| auto | fmt::detail::rangeEnd (const T(&arr)[N]) -> const T * |
|
template<typename T> |
| constexpr auto | fmt::detail::rangeBegin (T &&rng) -> decltype(static_cast< T && >(rng).begin()) |
|
template<typename T> |
| constexpr auto | fmt::detail::rangeEnd (T &&rng) -> decltype(static_cast< T && >(rng).end()) |
|
template<typename T> |
| auto | fmt::detail::rangeBegin (T &&rng) -> enable_if_t<!HasMemberFnBeginEndT< T && >::value, decltype(begin(static_cast< T && >(rng)))> |
|
template<typename T> |
| auto | fmt::detail::rangeEnd (T &&rng) -> enable_if_t<!HasMemberFnBeginEndT< T && >::value, decltype(end(static_cast< T && >(rng)))> |
|
template<typename Tuple, typename F, size_t... Is> |
| constexpr auto | fmt::detail::forEach (index_sequence< Is... >, Tuple &&t, F &&f) -> void |
|
template<typename Tuple, typename F> |
| constexpr auto | fmt::detail::forEach (Tuple &&t, F &&f) -> void |
|
template<typename Tuple1, typename Tuple2, typename F, size_t... Is> |
| auto | fmt::detail::forEach2 (index_sequence< Is... >, Tuple1 &&t1, Tuple2 &&t2, F &&f) -> void |
|
template<typename Tuple1, typename Tuple2, typename F> |
| auto | fmt::detail::forEach2 (Tuple1 &&t1, Tuple2 &&t2, F &&f) -> void |
|
template<typename Tuple, typename Char, size_t... Is> |
| auto | fmt::detail::tuple::getFormatters (index_sequence< Is... >) -> result_t< Char, decltype(get< Is >(std::declval< Tuple >()))... > |
| template<typename It, typename Sentinel> |
| auto | fmt::join (It begin, Sentinel end, StringView sep) -> JoinView< It, Sentinel > |
template<typename Range>
requires (!IsTupleLike<Range>::value) |
| constexpr auto | fmt::join (Range &&r, StringView sep) -> JoinView< decltype(detail::rangeBegin(r)), decltype(detail::rangeEnd(r))> |
template<typename Tuple>
requires (IsTupleLike<Tuple>::value) |
| constexpr auto | fmt::join (const Tuple &tuple FMT_LIFETIMEBOUND, StringView sep) -> TupleJoinView< Tuple, char > |
| template<typename T> |
| auto | fmt::join (std::initializer_list< T > list, StringView sep) -> JoinView< const T *, const T * > |
Formatters for ranges, tuples and maps.
Interface partition fmt:ranges.
- Copyright
- Copyright (c) 2012 - present, Victor Zverovich and {fmt} contributors. All rights reserved. For the license information refer to format.hpp.
template<typename Tuple>
requires (IsTupleLike<Tuple>::value)
Returns a view that formats a tuple with elements separated by sep.
Format specifiers apply to every element, so they must be valid for all of them.
- Parameters
-
| tuple | the tuple to join. The view refers to it, so it must outlive the formatting call. |
| sep | the separator written between elements. |
- Returns
- a view to pass to a formatting function.
Example:
auto t = std::tuple<int, char>(1, 'a');
fmt::print("{}", fmt::join(t, ", ")); // 1, a
template<typename Range>
requires (!IsTupleLike<Range>::value)
| auto fmt::join |
( |
Range && | r, |
|
|
StringView | sep ) -> JoinView< decltype(detail::rangeBegin(r)), decltype(detail::rangeEnd(r))> |
|
constexprexport |
Returns a view that formats r with elements separated by sep.
Unlike formatting the range directly, this writes no brackets and applies any format specifiers to each element rather than to the range as a whole.
- Parameters
-
| r | the range to join. The view refers to it, so it must outlive the formatting call; joining a temporary dangles. |
| sep | the separator written between elements. |
- Returns
- a view to pass to a formatting function.
Example:
auto v = std::vector<int>{1, 2, 3};
fmt::print("{}", fmt::join(v, ", ")); // 1, 2, 3
fmt::print("{:02}", fmt::join(v, ", ")); // 01, 02, 03