ChimeraTK-cppext 01.07.01
Loading...
Searching...
No Matches
cppext::ranges Namespace Reference

Namespaces

namespace  detail
 

Functions

template<template< typename... > class Container>
constexpr auto to ()
 Convert a C++ range into the given Container type.
 

Function Documentation

◆ to()

template<template< typename... > class Container>
constexpr auto cppext::ranges::to ( )
constexpr

Convert a C++ range into the given Container type.

Replacement for std::ranges::to, for use on compilers which still lack support (e.g. gcc 13).

Example: std::views::iota(0, 10) | cppext::ranges::to<std::vector>() This will result in an std::vector<int> filled with the numbers 0 to 9.

Currently, only std::vector is allowed for use as the Container template parameter.

Definition at line 33 of file ranges.hpp.