Skip to content

Commit

Permalink
Simplify IPC::SyncMessageSchema::WriteReplyParams() using variadic te…
Browse files Browse the repository at this point in the history
…mplates

Review URL: https://codereview.chromium.org/1036883002

Cr-Commit-Position: refs/heads/master@{#322368}
  • Loading branch information
mikhail.pozdnyakov authored and Commit bot committed Mar 26, 2015
1 parent bdc2507 commit cd0a664
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions ipc/ipc_message_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -906,33 +906,9 @@ class SyncMessageSchema {
return ok;
}

template<typename TA>
static void WriteReplyParams(Message* reply, TA a) {
ReplyParam p(a);
WriteParam(reply, p);
}

template<typename TA, typename TB>
static void WriteReplyParams(Message* reply, TA a, TB b) {
ReplyParam p(a, b);
WriteParam(reply, p);
}

template<typename TA, typename TB, typename TC>
static void WriteReplyParams(Message* reply, TA a, TB b, TC c) {
ReplyParam p(a, b, c);
WriteParam(reply, p);
}

template<typename TA, typename TB, typename TC, typename TD>
static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d) {
ReplyParam p(a, b, c, d);
WriteParam(reply, p);
}

template<typename TA, typename TB, typename TC, typename TD, typename TE>
static void WriteReplyParams(Message* reply, TA a, TB b, TC c, TD d, TE e) {
ReplyParam p(a, b, c, d, e);
template <typename... Ts>
static void WriteReplyParams(Message* reply, Ts... args) {
ReplyParam p(args...);
WriteParam(reply, p);
}
};
Expand Down

0 comments on commit cd0a664

Please sign in to comment.