Goose  Artifact [58bef9a850]

Artifact 58bef9a850fa2626486bda0bf7c56e237ac0a58124eab62eb26413ac406a9cd2:

  • File bs/builtins/types/template/tdecl.h — part of check-in [054862b9f5] at 2019-02-16 16:48:49 on branch trunk — Some reorganization of template types. (user: achavasse size: 871)

#ifndef EMPATHY_BUILTINS_TYPES_TEMPLATE_TDECL_H
#define EMPATHY_BUILTINS_TYPES_TEMPLATE_TDECL_H

namespace empathy::builtins
{
    class TDecl
    {
        public:
            template< typename T, typename V >
            TDecl( T&& type, V&& value ) :
                m_type( forward< T >( type ) ),
                m_value( forward< V >( value ) )
            {}

            const auto& type() const { return m_type; }
            const auto& value() const { return m_value; }

        private:
            Term m_type;
            Term m_value;
    };

    extern bool IsTDecl( const Value& td );
}

namespace empathy::ir
{
    template<>
    struct Bridge< builtins::TDecl >
    {
        static const Term& Type();
        static Value ToValue( const builtins::TDecl& td );
        static optional< builtins::TDecl > FromValue( const Value& v );
    };
}

#endif