Skip to content

LiteFX::Enumerable::Enumerable

Constructors

Synopses

Declared in <litefx/containers.hpp>

Creates an enumerable over an empty range.

» more...

Copy constructor

Enumerable(Enumerable const& range) = default;

» more...

Move constructor

Enumerable(Enumerable&& range) noexcept = default;

» more...

Initializes an enumerable from another enumerable with covariant elements, e.g. Enumerable<const Derived&> to Enumerable<const Base&>.

template<typename TOther>
requires (!std::is_same_v<TOther, T> && is_covariant<TOther, T>)
Enumerable(Enumerable<TOther> other);

» more...

Creates a new Enumerable instance from an underlying range.

template<typename TRange>
requires (
            !is_enumerable_v<std::remove_cvref_t<TRange>> &&
            std::ranges::viewable_range<TRange>&& std::ranges::forward_range<TRange> &&                                                             // The source range must be viewable and forward iterable.
            std::convertible_to<std::ranges::range_reference_t<decltype(std::views::common(std::declval<TRange>()))>, T> &&                         // The elements of the source range must be convertible to the elements of the enumerable.
            !(std::is_reference_v<T> && !std::is_reference_v<std::ranges::range_reference_t<decltype(std::views::common(std::declval<TRange>()))>>) // The source range must not yield temporaries (they would dangle).
        )
Enumerable(TRange&& range);

» more...

Template Parameters

NameDescription
TOtherThe value type of the other enumerable.
TRangeThe type of the underlying range.

Parameters

NameDescription
otherThe other enumerable.
rangeA reference of the underlying range.