AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
sequence.h
    1/*
    2 * AUI Framework - Declarative UI toolkit for modern C++20
    3 * Copyright (C) 2020-2025 Alex2772 and Contributors
    4 *
    5 * SPDX-License-Identifier: MPL-2.0
    6 *
    7 * This Source Code Form is subject to the terms of the Mozilla Public
    8 * License, v. 2.0. If a copy of the MPL was not distributed with this
    9 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
   10 */
   11
   12//
   13// Created by Alex2772 on 11/28/2021.
   14//
   15
   16#pragma once
   17
   18namespace aui {
   19    template<typename T = int>
   20    struct sequence_traits {
   21        template<T first_, T... up_>
   22        struct of {
   27            static constexpr T first() {
   28                return first_;
   29            }
   30
   35            static constexpr T last() {
   36                constexpr T ints[] = {first_, up_...};
   37                return ints[sizeof...(up_)];
   38            }
   39
   40
   46            static constexpr T at(unsigned index) {
   47                constexpr T ints[] = {first_, up_...};
   48                return ints[index];
   49            }
   50        };
   51    };
   52}
Definition sequence.h:22
static constexpr T last()
Definition sequence.h:35
static constexpr T first()
Definition sequence.h:27
static constexpr T at(unsigned index)
Definition sequence.h:46
Definition sequence.h:20