Skip to content
Snippets Groups Projects
Commit e8c4dead authored by Petr Rockai's avatar Petr Rockai
Browse files

MC: Add prepend{,_f} methods to Weaver.

parent 99aac1c9
No related branches found
No related tags found
No related merge requests found
...@@ -114,6 +114,13 @@ namespace divine::mc ...@@ -114,6 +114,13 @@ namespace divine::mc
return Extend< ExMachines... >( std::tuple_cat( _machines, ext ) ); return Extend< ExMachines... >( std::tuple_cat( _machines, ext ) );
} }
template< typename... ExMachines >
auto prepend( ExMachines... exm )
{
std::tuple< ExMachines... > ext( exm... );
return Weaver< TQ, ExMachines..., Machines... >( std::tuple_cat( ext, _machines ) );
}
template< typename M > template< typename M >
struct Ref : std::reference_wrapper< M > struct Ref : std::reference_wrapper< M >
{ {
...@@ -172,6 +179,12 @@ namespace divine::mc ...@@ -172,6 +179,12 @@ namespace divine::mc
return extend( Lambda< F >( fs ) ... ); return extend( Lambda< F >( fs ) ... );
} }
template< typename... F >
auto prepend_f( F... fs )
{
return prepend( Lambda< F >( fs ) ... );
}
Weaver( MachineT mt ) : _machines( mt ) {} Weaver( MachineT mt ) : _machines( mt ) {}
Weaver() = default; Weaver() = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment