76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
{
using intrinsicType = Intrinsic< Value ( T, T ) >;
auto intrinsicFunc = []( const Value& lhs, const Value& rhs )
{
return BuildComputedValue( GetValueType< RT >(), I( lhs, rhs ) );
};
pOvlSet->add( e, ToValue< intrinsicType >( move( intrinsicFunc ) ) );
};
}
template< typename T, typename F >
auto ForType( F&& func )
{
return [&]< typename tag >( auto&& e, auto&& pOvlSet, tag t )
{
if constexpr( is_same_v< tag, UnaryOpTag > )
{
using intrinsicType = Intrinsic< Value ( T ) >;
pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ) );
}
else
{
using intrinsicType = Intrinsic< Value ( T, T ) >;
pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ) );
}
};
}
template< typename T1, typename T2, typename F >
auto ForTypes( F&& func )
{
return [&]< typename tag >( auto&& e, auto&& pOvlSet, tag t )
{
using intrinsicType = Intrinsic< Value ( T1, T2 ) >;
pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ) );
};
}
}
#endif
|
|
|
|
|
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
|
{
using intrinsicType = Intrinsic< Value ( T, T ) >;
auto intrinsicFunc = []( const Value& lhs, const Value& rhs )
{
return BuildComputedValue( GetValueType< RT >(), I( lhs, rhs ) );
};
pOvlSet->add( e, ToValue< intrinsicType >( move( intrinsicFunc ) ), GetFuncInvocationRule() );
};
}
template< typename T, typename F >
auto ForType( F&& func )
{
return [&]< typename tag >( auto&& e, auto&& pOvlSet, tag t )
{
if constexpr( is_same_v< tag, UnaryOpTag > )
{
using intrinsicType = Intrinsic< Value ( T ) >;
pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ), GetFuncInvocationRule() );
}
else
{
using intrinsicType = Intrinsic< Value ( T, T ) >;
pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ), GetFuncInvocationRule() );
}
};
}
template< typename T1, typename T2, typename F >
auto ForTypes( F&& func )
{
return [&]< typename tag >( auto&& e, auto&& pOvlSet, tag t )
{
using intrinsicType = Intrinsic< Value ( T1, T2 ) >;
pOvlSet->add( e, ToValue< intrinsicType >( forward< F >( func ) ), GetFuncInvocationRule() );
};
}
}
#endif
|