Skip to content

Commit

Permalink
Make the return types of lambda functions implicit
Browse files Browse the repository at this point in the history
  • Loading branch information
abitmore committed Jun 5, 2021
1 parent 2b96d68 commit a68796b
Show file tree
Hide file tree
Showing 14 changed files with 42 additions and 28 deletions.
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_1(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_1::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_1::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_10.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_10(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_10::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_10::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_11(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_11::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_11::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_12(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_12::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_12::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_13.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_13(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_13::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_13::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_14.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_14(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_14::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_14::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_2(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_2::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_2::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_3(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_3::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_3::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_4(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_4::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_4::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_5(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_5::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_5::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_6(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_6::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_6::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_7.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_7(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_7::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_7::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_8(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_8::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_8::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }
5 changes: 3 additions & 2 deletions libraries/protocol/custom_authorities/list_9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ namespace graphene { namespace protocol {
using result_type = object_restriction_predicate<operation>;

result_type get_restriction_pred_list_9(size_t idx, vector<restriction> rs) {
return typelist::runtime::dispatch(operation_list_9::list(), idx, [&rs] (auto t) -> result_type {
return typelist::runtime::dispatch(operation_list_9::list(), idx, [&rs] (auto t) {
using Op = typename decltype(t)::type;
return [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
result_type to_return = [p=restrictions_to_predicate<Op>(std::move(rs), true)] (const operation& op) {
FC_ASSERT(op.which() == operation::tag<Op>::value,
"Supplied operation is incorrect type for restriction predicate");
return p(op.get<Op>());
};
return to_return;
});
}
} }

0 comments on commit a68796b

Please sign in to comment.