Logo

Programming-Idioms

History of Idiom 5 > diff from v362 to v363

Edit summary for version 363 by Meta:
New D implementation by user [Meta]

Version 362

2017-06-06, 15:14:10

Version 363

2017-07-26, 00:45:10

Idiom #5 Create a 2D Point data structure

Declare a container type for two floating-point numbers x and y

Illustration

Idiom #5 Create a 2D Point data structure

Declare a container type for two floating-point numbers x and y

Illustration
Code
class Point
{
	float x;
	float y;
}
Comments bubble
D supports both struct (value types) and classes (reference types)