#ifndef EMPATHY_IR_ANYTERM_H
#define EMPATHY_IR_ANYTERM_H

namespace empathy::ir
{
    class AnyTerm
    {
        public:
            template< typename S >
            AnyTerm( S&& varName ) :
                m_varName( varName )
            {}

            const auto& varName() const { return m_varName; }
            friend ostream& ToString( ostream& out, const AnyTerm& v );

            constexpr auto operator==( const AnyTerm& rhs ) const
            {
                return m_varName == rhs.m_varName;
            }

            friend ostream& operator<<( ostream& out, const AnyTerm& x )
            {
                return out << x.m_varName;
            }

        private:
            StringId m_varName;
    };
}

namespace std
{
    template<> struct hash< empathy::ir::AnyTerm >
    {
        size_t operator()( const empathy::ir::AnyTerm& x ) const
        {
            return hash< empathy::util::StringId >()( x.varName() );
        }
    };
}

#endif
