From 2da4b8663326026b46efad923872768039cf33dd Mon Sep 17 00:00:00 2001 From: eiffel-org Date: Wed, 21 Sep 2016 15:22:47 +0000 Subject: [PATCH] Update wikipage Code Templates. (Signed-off-by:javier). git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1617 abb3cda0-5349-4a8f-a601-0c33ac3a8c38 --- .../eiffelstudio-editor/Code-Templates.wiki | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/documentation/trunk/eiffelstudio/eiffelstudio-reference/eiffelstudio-editor/Code-Templates.wiki b/documentation/trunk/eiffelstudio/eiffelstudio-reference/eiffelstudio-editor/Code-Templates.wiki index d5ff1c08..28469291 100644 --- a/documentation/trunk/eiffelstudio/eiffelstudio-reference/eiffelstudio-editor/Code-Templates.wiki +++ b/documentation/trunk/eiffelstudio/eiffelstudio-reference/eiffelstudio-editor/Code-Templates.wiki @@ -20,7 +20,37 @@ Code templates in Eiffel are described in Eiffel itself, there are some constrai ==Templates Skeleton== - +===With Generic Constraints=== + + +note + description: "[ + Code templates for Arrays of COMPARABLES. + ]" + template_version: "1.0" + + +class ARRAY_TEMPLATE [T -> COMPARABLE] + +inherit + + TEMPLATE [ARRAY [T]] + +feature -- Templates + + slice_maximum (low, high: INTEGER): T + -- Get the maximum of an array, where the interval is defined by default by array.lower |..| + -- array.upper. + note + tags: "Algorithm, Maximum, ARRAY" + default: "a.lower, a.upper" + do + across low |..| high as i loop + Result := Result.max (a [i.item]) + end + end +end +