From f1448bf024c8bb464a15914e11f1f773192e671c Mon Sep 17 00:00:00 2001 From: phintuka Date: Mon, 15 Mar 2010 14:13:43 +0000 Subject: Template for void func(a,b,c,d,e) --- tools/listiter.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/listiter.h b/tools/listiter.h index e16353cb..f1ea1308 100644 --- a/tools/listiter.h +++ b/tools/listiter.h @@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: listiter.h,v 1.2 2010-02-03 13:58:05 phintuka Exp $ + * $Id: listiter.h,v 1.3 2010-03-15 14:13:43 phintuka Exp $ * */ @@ -35,6 +35,13 @@ void ForEach(LIST& List, void (ITEM::*f)(ARG1,ARG2), ARG1 arg1, ARG2 arg2) (*it.*f)(arg1,arg2); } +template + void ForEach(LIST& List, void (ITEM::*f)(ARG1,ARG2,ARG3,ARG4,ARG5), ARG1 arg1, ARG2 arg2, ARG3 arg3, ARG4 arg4, ARG5 arg5) +{ + for(ITEM *it = List.First(); it; it = List.Next(it)) + (*it.*f)(arg1,arg2,arg3,arg4,arg5); +} + template RESULT ForEach(LIST& List, RESULT (ITEM::*f)(ARG1), ARG1 arg1, RESULT (*combiner)(RESULT,RESULT), RESULT def) -- cgit v1.2.3