cp-library

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

View the Project on GitHub ttamx/cp-library

:warning: group/monoid/monoid-base.hpp

Code

#pragma once

/**
 * Author: Teetat T.
 * Date: 2024-05-16
 * Description: Monoid Base class.
 */

template<class T,T (*combine)(T,T),T (*identity)()>
struct MonoidBase{
    using value_type = T;
    static constexpr T op(const T &x,const T &y){return combine(x,y);}
    static constexpr T unit(){return identity();}
};
#line 2 "group/monoid/monoid-base.hpp"

/**
 * Author: Teetat T.
 * Date: 2024-05-16
 * Description: Monoid Base class.
 */

template<class T,T (*combine)(T,T),T (*identity)()>
struct MonoidBase{
    using value_type = T;
    static constexpr T op(const T &x,const T &y){return combine(x,y);}
    static constexpr T unit(){return identity();}
};
Back to top page