Goose  Artifact [afcc4d24e4]

Artifact afcc4d24e44f6b7929685f538ca412f0442f968e8b1df62213e2996cc3f64399:

  • File bs/ir/bridge.h — part of check-in [883bfdaa35] at 2019-02-03 11:43:24 on branch trunk — Sema: implemented Decl and its conversion from/to ir. (user: achavasse size: 741)

#ifndef EMPATHY_IR_BRIDGE_H
#define EMPATHY_IR_BRIDGE_H

namespace empathy::ir
{
    template< typename T >
    struct Bridge
    {};

    template< typename T, typename... P >
    const Term& GetValueType( P&&... params )
    {
        return Bridge< T >::Type( forward< P >( params )... );
    }

    template< typename T >
    Value ToValue( T&& x )
    {
        using TT = remove_constref_t< T >;
        return Bridge< TT >::ToValue( forward< T >( x ) );
    }

    template< typename TT, typename T >
    Value ToValue( T&& x )
    {
        return Bridge< TT >::ToValue( forward< T >( x ) );
    }

    template< typename T >
    auto FromValue( const Value& val )
    {
        return Bridge< T >::FromValue( val );
    }
}

#endif