std::experi...ream_joiner(3)
πΈ NAME πΈ
okay bestie, welcome to the std::experi...ream_joiner(3) page β yes, it's the std::experimental::make_ostream_joiner(3) manual, straight from the C++ Standard Libary and living its best library fundamentals TS v2 life β¨
std::experimental::make_ostream_joiner β std::experimental::make_ostream_joiner
π Synopsis π
This cutie is defined in header <experimental/iterator> π
template< class CharT, class Traits, class DelimT >
std::experimental::ostream_joiner<std::decay_t<DelimT>, CharT, Traits>
make_ostream_joiner( std::basic_ostream<CharT, Traits>& os,
DelimT&& delimiter );
It creates an ostream_joiner object, deducing the template arguments from the types of the function arguments. periodt π
π Parameters π
osβ thebasic_ostreamobject that the iterator is to be associated to πdelimiterβ the delimiter πΈ
β¨ Return value β¨
An ostream_joiner object, created as if by:
std::experimental::ostream_joiner<std::decay_t<DelimT>, CharT, Traits>(os,
std::forward<DelimT>(delimiter))
no cap, that's the exact vibe π₯
π» Example π»
// Run this code
#include <experimental/iterator>
#include <iostream>
#include <vector>
int main()
{
std::vector<int> x{1, 2, 3, 4};
std::copy(x.begin(), x.end(),
std::experimental::make_ostream_joiner(std::cout, ", "));
}
π Output π
1, 2, 3, 4
this iconic page is from http://cppreference.com, dated 2024.06.10 β bye bestie, go slay some iterators ππ«Ά
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms