simple_enum

enum_view

Overview

enum_view is a class template that provides a range view over an enumeration, facilitating iteration over its values. It conforms to std::ranges::view_interface, ensuring compatibility with the Standard Library’s ranges.

Requirements

Constructors

Example Usage

constexpr auto view_over_lorem_ipsum = enum_view<lorem_ipsum>{} | std::views::transform(enum_name);
std::cout << "simple_enum " SIMPLE_ENUM_NAME_VERSION "\n";
for(auto data: view_over_lorem_ipsum)
    std::cout << " " << data << '\n';

This example demonstrates creating an enum_view over the lorem_ipsum enumeration, transforming it with enum_name for string representation, and iterating over the values to print them.

Deduction Guides

These guides assist in the automatic deduction of the enum_view template arguments, simplifying its usage.

Notes