EN | DE

Stage 4.7: Unit-like Structs

Structs do not have to have any fields at all.

As mentioned in Chapter 1 a unit is another word for an empty tuple (). This is why this kind of struct is called Unit-like.

This type of struct is rarely used.

Tags: #structs
Share on Facebook Share on Twitter Share on Reddit Save on Pocket Share on LinkedIn Share via email