proconlib

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

View the Project on GitHub KodamaD/proconlib

:heavy_check_mark: traits/assign_monoid.cpp

Verified with

Code

#pragma once
#include <optional>

template <class T> struct AssignMonoid {
    using Type = std::optional<T>;
    static constexpr Type identity() { return std::nullopt; }
    static constexpr Type operation(const Type& l, const Type& r) { return r ? r : l; }
};
#line 2 "traits/assign_monoid.cpp"
#include <optional>

template <class T> struct AssignMonoid {
    using Type = std::optional<T>;
    static constexpr Type identity() { return std::nullopt; }
    static constexpr Type operation(const Type& l, const Type& r) { return r ? r : l; }
};
Back to top page