WPILibC++ 2024.3.2
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 >())), int > >
 
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  detail::parse_empty_specs< ParseContext >
 
struct  detail::format_tuple_element< FormatContext >
 
struct  is_tuple_like< T >
 
struct  is_tuple_formattable< T, C >
 
struct  formatter< Tuple, Char, enable_if_t< fmt::is_tuple_like< Tuple >::value &&fmt::is_tuple_formattable< Tuple, 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 > >, is_formattable< 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 >
 
class  detail::is_container_adaptor_like< T >
 
struct  detail::all< Container >
 
struct  formatter< T, Char, enable_if_t< conjunction< detail::is_container_adaptor_like< T >, bool_constant< range_format_kind< T, Char >::value==range_format::disabled > >::value > >
 

Namespaces

namespace  detail
 detail namespace with internal helper functions
 
namespace  detail::tuple
 

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 Char , typename... T>
using detail::tuple::result_t = std::tuple< formatter< remove_cvref_t< T >, Char >... >
 
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 Char , typename Element >
using detail::range_formatter_type = formatter< remove_cvref_t< decltype(range_mapper< buffer_context< Char > >{}.map(std::declval< 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 >
 

Enumerations

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

Functions

template<typename Range , typename OutputIt >
auto detail::copy (const Range &range, OutputIt out) -> OutputIt
 
template<typename OutputIt >
auto detail::copy (const char *str, OutputIt out) -> OutputIt
 
template<typename OutputIt >
auto detail::copy (char ch, OutputIt out) -> OutputIt
 
template<typename OutputIt >
auto detail::copy (wchar_t ch, OutputIt out) -> OutputIt
 
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<typename Tuple , typename F , size_t... Is>
FMT_CONSTEXPR void detail::for_each (index_sequence< Is... >, Tuple &&t, F &&f)
 
template<typename Tuple , typename F >
FMT_CONSTEXPR void detail::for_each (Tuple &&t, F &&f)
 
template<typename Tuple1 , typename Tuple2 , typename F , size_t... Is>
void detail::for_each2 (index_sequence< Is... >, Tuple1 &&t1, Tuple2 &&t2, F &&f)
 
template<typename Tuple1 , typename Tuple2 , typename F >
void detail::for_each2 (Tuple1 &&t1, Tuple2 &&t2, F &&f)
 
template<typename Tuple , typename Char , std::size_t... Is>
auto detail::tuple::get_formatters (index_sequence< Is... >) -> result_t< Char, decltype(get< Is >(std::declval< Tuple >()))... >
 
template<typename Formatter >
FMT_CONSTEXPR auto detail::maybe_set_debug_format (Formatter &f, bool set) -> decltype(f.set_debug_format(set))
 
template<typename Formatter >
FMT_CONSTEXPR void detail::maybe_set_debug_format (Formatter &,...)
 
template<typename... T>
FMT_BEGIN_EXPORT 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

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_BEGIN_EXPORT 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