This documentation is automatically generated by competitive-verifier/competitive-verifier
#include "tools/commutative_monoid.hpp"template <typename M>
concept commutative_monoid = tools::monoid<M>;
It is a concept that represents a commutative monoid. Note that semantic constraints must be guaranteed by the user.
Semantically, you can define that the result of M::op is undefined depending on the arguments.
For example, you can define that integer addition is not defined for overflowing pairs.
<M> satisfies the concept of tools::commutative_monoid, the following conditions must also be satisfied.
tools::monoid<M> hold.M::op(x, y) and M::op(y, x) are defined, M::op(x, y) $=$ M::op(y, x).#ifndef TOOLS_COMMUTATIVE_MONOID_HPP
#define TOOLS_COMMUTATIVE_MONOID_HPP
#include "tools/monoid.hpp"
namespace tools {
template <typename M>
concept commutative_monoid = tools::monoid<M>;
}
#endif
#line 1 "tools/commutative_monoid.hpp"
#line 1 "tools/monoid.hpp"
#include <concepts>
namespace tools {
template <typename M>
concept monoid = requires(typename M::T x, typename M::T y) {
{ M::op(x, y) } -> std::same_as<typename M::T>;
{ M::e() } -> std::same_as<typename M::T>;
};
}
#line 5 "tools/commutative_monoid.hpp"
namespace tools {
template <typename M>
concept commutative_monoid = tools::monoid<M>;
}