From 4da9b7d377e397b1076a5f19cf7e38e734fefbd3 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 10 Aug 2026 11:10:31 +0100 Subject: Generate builders for generic structs --- examples/03-struct-generic/src/point.hob | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'examples/03-struct-generic/src') diff --git a/examples/03-struct-generic/src/point.hob b/examples/03-struct-generic/src/point.hob index 3ed314a..f923785 100644 --- a/examples/03-struct-generic/src/point.hob +++ b/examples/03-struct-generic/src/point.hob @@ -1,3 +1,13 @@ +/// A 2D drawing made up of straight lines. +struct LineDrawing2D { + field lines: Line[Point2D]; +} + +/// A drawing made up of straight lines. +struct LineDrawing[TPoint] { + field lines: Line[TPoint]; +} + /// A straight line from one point to another. struct Line[TPoint] { field start: TPoint; @@ -5,7 +15,7 @@ struct Line[TPoint] { } /// A 2D point. -struct Point { +struct Point2D { field x: Int32; field y: Int32; } -- cgit v1.2.3