On Monday, 28 November 2022 at 07:06:56 UTC, Max Samukha wrote:
>Why is that absurd?
This:
struct Entity
{
enum Kind
{
}
Kind entity;
}
instead of this:
enum EntityKind
{
}
struct Entity
{
EntityKind entity;
}
is a common practice.
About nesting in general I've replied to ryuukk_ at https://forum.dlang.org/post/gjhvbrehodkabzvewopx@forum.dlang.org
In this example there's little difference, between having to type (or not) either Entity.Kind or EntityKind. It's indeed a good example how nesting without private data is a purely stylistic namespacing choice. (So imo no one forces you to use it to an extent that requires you to type too much or otherwise makes your life difficult.)
Permalink
Reply