rcpl

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub ruthen71/rcpl

:heavy_check_mark: algebra/monoid/monoid_assign.hpp

Required by

Verified with

Code

#pragma once

template <class T, T none> struct MonoidAssign {
    using value_type = T;
    static constexpr T operation(const T& a, const T& b) noexcept {
        if (b == identity()) {
            return a;
        }
        return b;
    }
    static constexpr T identity() noexcept { return none; }
    static constexpr bool commutative = false;
};
#line 2 "algebra/monoid/monoid_assign.hpp"

template <class T, T none> struct MonoidAssign {
    using value_type = T;
    static constexpr T operation(const T& a, const T& b) noexcept {
        if (b == identity()) {
            return a;
        }
        return b;
    }
    static constexpr T identity() noexcept { return none; }
    static constexpr bool commutative = false;
};
Back to top page