Пример #1
0
int main()
{
    Tuple<int, int, int> t1 = make_tuple(1, 2, 3);
    Tuple<int, int, int> t2 = make_tuple(4, 5, 6);
    
    std::cout << t1 << std::endl;
    std::cout << t2 << std::endl;
    std::cout << tuple_cat(t1, t2) << std::endl;
    std::cout << tuple_cat(tuple_cat(t1, t2), tuple_cat(t1, t2)) << std::endl;
}
 static R run(SimpleInterpreter *inter, void* f, T a) {
     auto p = inter->loadVariable(index);
     switch (p._type) {
         case VT_DOUBLE:
             return Collector<index + 1, size, R, decltype(tuple_cat(a, make_tuple(p.getDoubleValue())))>::
                     run(inter, f, tuple_cat(a, make_tuple(p.getDoubleValue())));
         case VT_INT:
             return Collector<index + 1, size, R, decltype(tuple_cat(a, make_tuple(p.getIntValue())))>::
                     run(inter, f, tuple_cat(a, make_tuple(p.getIntValue())));
         case VT_STRING:
             return Collector<index + 1, size, R, decltype(tuple_cat(a, make_tuple(p.getStringValue())))>::
                     run(inter, f, tuple_cat(a, make_tuple(p.getStringValue())));
         default:
             throw InterpretationError("Unknown type of " + to_string(index) + " function parameter");
     }
 }
Пример #3
0
 std::enable_if_t<B, void> eval_to(param_type& result) const {
   tuple_apply(eval_op_, tuple_cat(data_, std::tie(result)));
 }
Пример #4
0
 match_expr<Cs..., Ds...> or_else(const match_expr<Ds...>& other) const {
   return {tuple_cat(m_cases, other.cases())};
 }
Пример #5
0
constexpr
tuple<Ts...,T>
cshift1(tuple<T,Ts...> t) {
  return tuple_cat(tuple_tail(t),make_tuple(get<0>(t)));
}
Пример #6
0
constexpr
tuple<Ts...,Us...>
cat(tuple<Ts...> t1, tuple<Us...> t2) {
  return tuple_cat(t1,t2);
}