WPILibC++ 2023.4.3-108-ge5452e3
ranges.h File Reference
#include <initializer_list>
#include <tuple>
#include <type_traits>
#include "format.h"

Go to the source code of this file.

Classes

class  detail::is_std_string_like< T >
 
struct  detail::is_std_string_like< fmt::basic_string_view< Char > >
 
class  detail::is_map< T >
 
class  detail::is_set< T >
 
struct  detail::conditional_helper< Ts >
 
struct  detail::is_range_< T, _ >
 
struct  detail::has_member_fn_begin_end_t< T, Enable >
 
struct  detail::has_member_fn_begin_end_t< T, void_t< decltype(std::declval< T >().begin()), decltype(std::declval< T >().end())> >
 
struct  detail::has_const_begin_end< T, Enable >
 
struct  detail::has_mutable_begin_end< T, Enable >
 
struct  detail::has_const_begin_end< T, void_t< decltype(detail::range_begin(std::declval< const remove_cvref_t< T > & >())), decltype(detail::range_end(std::declval< const remove_cvref_t< T > & >()))> >
 
struct  detail::has_mutable_begin_end< T, void_t< decltype(detail::range_begin(std::declval< T >())), decltype(detail::range_end(std::declval< T >())), enable_if_t< std::is_copy_constructible< T >::value > > >
 
struct  detail::is_range_< T, void >
 
class  detail::is_tuple_like_< T >
 
struct  detail::integer_sequence< T, N >
 
struct  detail::make_integer_sequence< T, N, Ns >
 
struct  detail::make_integer_sequence< T, 0, Ns... >
 
class  detail::is_tuple_formattable_< T, C, bool >
 
class  detail::is_tuple_formattable_< T, C, true >
 
struct  is_tuple_like< T >
 
struct  is_tuple_formattable< T, C >
 
struct  formatter< TupleT, Char, enable_if_t< fmt::is_tuple_like< TupleT >::value &&fmt::is_tuple_formattable< TupleT, Char >::value > >
 
struct  is_range< T, Char >
 
struct  detail::range_mapper< Context >
 
struct  detail::is_formattable_delayed< R, Char >
 
struct  range_formatter< T, Char, enable_if_t< conjunction< std::is_same< T, remove_cvref_t< T > >, disjunction< is_formattable< T, Char >, detail::has_fallback_formatter< T, Char > > >::value > >
 
struct  detail::range_format_kind_< T >
 
struct  detail::range_default_formatter< K, R, Char, enable_if_t<(K==range_format::sequence||K==range_format::map||K==range_format::set)> >
 
struct  range_format_kind< T, Char, Enable >
 
struct  formatter< R, Char, enable_if_t< conjunction< bool_constant< range_format_kind< R, Char >::value !=range_format::disabled >, detail::is_formattable_delayed< R, Char > >::value > >
 
struct  tuple_join_view< Char, T >
 
struct  formatter< tuple_join_view< Char, T... >, Char >
 

Namespaces

namespace  detail
 

Macros

#define FMT_DECLTYPE_RETURN(val)
 
#define FMT_TUPLE_JOIN_SPECIFIERS   0
 

Typedefs

template<size_t... N>
using detail::index_sequence = integer_sequence< size_t, N... >
 
template<size_t N>
using detail::make_index_sequence = make_integer_sequence< size_t, N >
 
template<typename T >
using detail::tuple_index_sequence = make_index_sequence< std::tuple_size< T >::value >
 
template<typename Range >
using detail::range_reference_type = decltype(*detail::range_begin(std::declval< Range & >()))
 
template<typename Range >
using detail::uncvref_type = remove_cvref_t< range_reference_type< Range > >
 
template<typename Range >
using detail::uncvref_first_type = remove_cvref_t< decltype(std::declval< range_reference_type< Range > >().first)>
 
template<typename Range >
using detail::uncvref_second_type = remove_cvref_t< decltype(std::declval< range_reference_type< Range > >().second)>
 
template<typename Char , typename Element >
using detail::range_formatter_type = conditional_t< is_formattable< Element, Char >::value, formatter< remove_cvref_t< decltype(range_mapper< buffer_context< Char > >{}.map(std::declval< Element >()))>, Char >, fallback_formatter< Element, Char > >
 
template<typename R >
using detail::maybe_const_range = conditional_t< has_const_begin_end< R >::value, const R, R >
 
template<range_format K>
using detail::range_format_constant = std::integral_constant< range_format, K >
 
template<typename Char , typename... T>
using tuple_arg_join = tuple_join_view< Char, T... >
 

Enumerations

enum class  range_format {
  disabled , map , set , sequence ,
  string , debug_string
}
 

Functions

template<typename RangeT , typename OutputIterator >
OutputIterator detail::copy (const RangeT &range, OutputIterator out)
 
template<typename OutputIterator >
OutputIterator detail::copy (const char *str, OutputIterator out)
 
template<typename OutputIterator >
OutputIterator detail::copy (char ch, OutputIterator out)
 
template<typename OutputIterator >
OutputIterator detail::copy (wchar_t ch, OutputIterator out)
 
template<typename T , std::size_t N>
auto detail::range_begin (const T(&arr)[N]) -> const T *
 
template<typename T , std::size_t N>
auto detail::range_end (const T(&arr)[N]) -> const T *
 
template<typename T >
auto detail::range_begin (T &&rng) FMT_DECLTYPE_RETURN(static_cast< T && >(rng).begin())
 
template<typename T >
auto detail::range_end (T &&rng) FMT_DECLTYPE_RETURN(static_cast< T && >(rng).end())
 
template<typename T >
auto detail::range_begin (T &&rng) -> enable_if_t<!has_member_fn_begin_end_t< T && >::value, decltype(begin(static_cast< T && >(rng)))>
 
template<typename T >
auto detail::range_end (T &&rng) -> enable_if_t<!has_member_fn_begin_end_t< T && >::value, decltype(end(static_cast< T && >(rng)))>
 
template<class Tuple , class F , size_t... Is>
void detail::for_each (index_sequence< Is... >, Tuple &&tup, F &&f) noexcept
 
template<class T >
FMT_CONSTEXPR make_index_sequence< std::tuple_size< T >::valuedetail::get_indexes (T const &)
 
template<class Tuple , class F >
void detail::for_each (Tuple &&tup, F &&f)
 
template<typename OutputIt >
OutputIt detail::write_delimiter (OutputIt out)
 
template<typename Char , typename OutputIt >
auto detail::write_range_entry (OutputIt out, basic_string_view< Char > str) -> OutputIt
 
template<typename Char , typename OutputIt , typename T , FMT_ENABLE_IF(std::is_convertible< T, std_string_view< char > >::value) >
auto detail::write_range_entry (OutputIt out, const T &str) -> OutputIt
 
template<typename Char , typename OutputIt , typename Arg , FMT_ENABLE_IF(std::is_same< Arg, Char >::value) >
OutputIt detail::write_range_entry (OutputIt out, const Arg v)
 
template<typename Char , typename OutputIt , typename Arg , FMT_ENABLE_IF(!is_std_string_like< typename std::decay< Arg >::type >::value && !std::is_same< Arg, Char >::value) >
OutputIt detail::write_range_entry (OutputIt out, const Arg &v)
 
template<typename... T>
FMT_MODULE_EXPORT_BEGIN FMT_CONSTEXPR auto join (const std::tuple< T... > &tuple, string_view sep) -> tuple_join_view< char, T... >
 \rst Returns an object that formats tuple with elements separated by sep. More...
 
template<typename... T>
FMT_CONSTEXPR auto join (const std::tuple< T... > &tuple, basic_string_view< wchar_t > sep) -> tuple_join_view< wchar_t, T... >
 
template<typename T >
auto join (std::initializer_list< T > list, string_view sep) -> join_view< const T *, const T * >
 \rst Returns an object that formats initializer_list with elements separated by sep. More...
 

Macro Definition Documentation

◆ FMT_DECLTYPE_RETURN

#define FMT_DECLTYPE_RETURN (   val)
Value:
->decltype(val) { return val; } \
static_assert( \
true, "")

◆ FMT_TUPLE_JOIN_SPECIFIERS

#define FMT_TUPLE_JOIN_SPECIFIERS   0

Typedef Documentation

◆ tuple_arg_join

template<typename Char , typename... T>
using tuple_arg_join = tuple_join_view<Char, T...>

Enumeration Type Documentation

◆ range_format

enum class range_format
strong
Enumerator
disabled 
map 
set 
sequence 
string 
debug_string 

Function Documentation

◆ join() [1/3]

template<typename... T>
FMT_CONSTEXPR auto join ( const std::tuple< T... > &  tuple,
basic_string_view< wchar_t >  sep 
) -> tuple_join_view<wchar_t, T...>

◆ join() [2/3]

template<typename... T>
FMT_MODULE_EXPORT_BEGIN FMT_CONSTEXPR auto join ( const std::tuple< T... > &  tuple,
string_view  sep 
) -> tuple_join_view<char, T...>

\rst Returns an object that formats tuple with elements separated by sep.

Example**::

std::tuple<int, char> t = {1, 'a'}; fmt::print("{}", fmt::join(t, ", ")); Output: "1, a" \endrst

◆ join() [3/3]

template<typename T >
auto join ( std::initializer_list< T >  list,
string_view  sep 
) -> join_view<const T*, const T*>

\rst Returns an object that formats initializer_list with elements separated by sep.

Example**::

fmt::print("{}", fmt::join({1, 2, 3}, ", ")); Output: "1, 2, 3" \endrst