Midge  v3.9.2
Data Processing Framework
typereplace.hh
Go to the documentation of this file.
1 /*
2  * typereplace.hh
3  *
4  * Created on: Dec 15, 2018
5  * Author: obla999
6  */
7 
8 #ifndef MIDGE_TYPEREPLACE_HH_
9 #define MIDGE_TYPEREPLACE_HH_
10 
11 #include <type_traits>
12 
13 namespace midge
14 {
15 
16  template< class x_list, class x_find, class x_replace >
18 
19  template< template<class...> class x_list, class x_find, class x_replace, class... x_types >
20  struct type_replace_imp< x_list<x_types...>, x_find, x_replace >
21  {
22  using type = x_list<
23  typename std::conditional<
24  std::is_same< x_find, x_types >::value,
25  x_replace,
26  x_types
27  >::type...
28  >;
29  };
30 
31  template< class x_list, class x_find, class x_replace >
33 
34 }
35 
36 #endif /* MIDGE_TYPEREPLACE_HH_ */
Definition: _buffer.hh:11
typename type_replace_imp< x_list, x_find, x_replace >::type type_replace
Definition: typereplace.hh:32
x_list< typename std::conditional< std::is_same< x_find, x_types >::value, x_replace, x_types >::type... > type
Definition: typereplace.hh:28