libzypp: zyppng::ranges Namespace Reference

libzypp 17.38.7

zyppng::ranges Namespace Reference

## Namespaces
namespace | detail

## Classes
struct | to_fn

## Functions
template<typename Container, typename Range>
Container | to (Range &&range)
| Convert any range into a Container.
template<typename Container>
to_fn< Container > | to ()

## Function Documentation

## ◆ to() [1/2]

template<typename Container, typename Range>

Container zyppng::ranges::to | ( | Range && | range | ) |

Convert any range into a Container.

- Reserves capacity upfront if Container supports .reserve() and Range supports .size().
- Moves elements if Range&& is an rvalue reference, copies otherwise.

Usage: auto v = myRange | zyppng::ranges::to<std::vector<int>>(); auto s = zyppng::ranges::to<std::set<Foo>>( filteredRange );

Definition at line 109 of file ranges.h.

## ◆ to() [2/2]

template<typename Container>

to_fn< Container > zyppng::ranges::to | ( |  | ) |

Definition at line 138 of file ranges.h.