AUI Framework  master
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
PropertyModifier.h
    1// AUI Framework - Declarative UI toolkit for modern C++20
    2// Copyright (C) 2020-2025 Alex2772 and Contributors
    3//
    4// SPDX-License-Identifier: MPL-2.0
    5//
    6// This Source Code Form is subject to the terms of the Mozilla Public
    7// License, v. 2.0. If a copy of the MPL was not distributed with this
    8// file, You can obtain one at http://mozilla.org/MPL/2.0/.
    9
   10#pragma once
   11
   12#include <AUI/Traits/concepts.h>
   13
   14namespace aui {
   25template<typename Property>
   27}
   28
   29template<typename T>
   30inline decltype(auto) operator*(aui::PropertyModifier<T>&& t) {
   31    return t.value();
   32}
   33
   34template<typename T>
   35inline decltype(auto) operator*(const aui::PropertyModifier<T>& t) {
   36    return t.value();
   37}
   38
   39template<typename T, typename Rhs>
   40[[nodiscard]]
   41inline auto operator==(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   42    return *lhs == std::forward<Rhs>(rhs);
   43}
   44
   45template<typename T, typename Rhs>
   46[[nodiscard]]
   47inline auto operator!=(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   48    return *lhs != std::forward<Rhs>(rhs);
   49}
   50
   51template<typename T, typename Rhs>
   52[[nodiscard]]
   53inline auto operator<<(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   54    return *lhs << std::forward<Rhs>(rhs);
   55}
   56
   57template<typename T, typename Rhs>
   58[[nodiscard]]
   59inline auto operator>>(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   60    return *lhs >> std::forward<Rhs>(rhs);
   61}
   62
   63template<typename T, typename Rhs>
   64[[nodiscard]]
   65inline auto operator<(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   66    return *lhs < std::forward<Rhs>(rhs);
   67}
   68
   69template<typename T, typename Rhs>
   70[[nodiscard]]
   71inline auto operator>(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   72    return *lhs > std::forward<Rhs>(rhs);
   73}
   74
   75template<typename T, typename Rhs>
   76[[nodiscard]]
   77inline auto operator<=(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   78    return *lhs <= std::forward<Rhs>(rhs);
   79}
   80
   81template<typename T, typename Rhs>
   82[[nodiscard]]
   83inline auto operator>=(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   84    return *lhs >= std::forward<Rhs>(rhs);
   85}
   86
   87template<AAnyProperty T, typename Rhs>
   88[[nodiscard]]
   89inline auto operator+(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   90    return *lhs + std::forward<Rhs>(rhs);
   91}
   92
   93template<AAnyProperty T, typename Rhs>
   94[[nodiscard]]
   95inline auto operator-(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
   96    return *lhs - std::forward<Rhs>(rhs);
   97}
   98
   99template<AAnyProperty T, typename Rhs>
  100[[nodiscard]]
  101inline auto operator+=(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
  102    return *lhs += std::forward<Rhs>(rhs);
  103}
  104
  105template<AAnyProperty T, typename Rhs>
  106[[nodiscard]]
  107inline auto operator-=(const aui::PropertyModifier<T>& lhs, Rhs&& rhs) {
  108    return *lhs -= std::forward<Rhs>(rhs);
  109}
Temporary transparent object that gains write access to underlying property's value,...
Definition PropertyModifier.h:26