FE 0.9.0
Header-only C++ frontend library
Loading...
Searching...
No Matches
fe::Join< R > Class Template Reference

Join elements of range with sep. More...

#include <fe/format.h>

Public Types

using View = std::views::all_t<R>

Public Member Functions

 Join (R &&range, std::string_view sep=", ")
const auto & range () const
std::string_view sep () const

Friends

std::ostream & operator<< (std::ostream &os, const Join &j)

Detailed Description

template<std::ranges::input_range R>
requires Formattable<std::remove_cvref_t<std::ranges::range_reference_t<std::views::all_t<R>>>>
class fe::Join< R >

Join elements of range with sep.

Use as a std::format or operator<< argument: std::format("{}", fe::Join(v, ", ")).

Definition at line 125 of file format.h.

Member Typedef Documentation

◆ View

template<std::ranges::input_range R>
using fe::Join< R >::View = std::views::all_t<R>

Definition at line 127 of file format.h.

Constructor & Destructor Documentation

◆ Join()

template<std::ranges::input_range R>
fe::Join< R >::Join ( R && range,
std::string_view sep = ", " )
inline

Definition at line 129 of file format.h.

References range(), and sep().

Referenced by operator<<.

Member Function Documentation

◆ range()

template<std::ranges::input_range R>
const auto & fe::Join< R >::range ( ) const
inline

Definition at line 133 of file format.h.

Referenced by Join().

◆ sep()

template<std::ranges::input_range R>
std::string_view fe::Join< R >::sep ( ) const
inline

Definition at line 134 of file format.h.

Referenced by Join(), and operator<<.

◆ operator<<

template<std::ranges::input_range R>
std::ostream & operator<< ( std::ostream & os,
const Join< R > & j )
friend

Definition at line 136 of file format.h.

References Join(), and sep().


The documentation for this class was generated from the following file: