Re: struct parameterless constructor

2025-08-04 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Aug 04, 2025 at 08:02:48PM +, Brother Bill via Digitalmars-d-learn wrote: > I feel like I am going into the hornet's nest with this discussion. You are. ;-) > I have created a struct with some members, and want to have a > parameterless constructor that sets the member values at run

Re: struct parameterless constructor

2025-08-04 Thread Alex Bryan via Digitalmars-d-learn
On Monday, 4 August 2025 at 20:02:48 UTC, Brother Bill wrote: I feel like I am going into the hornet's nest with this discussion. I have created a struct with some members, and want to have a parameterless constructor that sets the member values at run time. I have seen things like @disable

Re: struct parameterless constructor

2025-08-04 Thread monkyyy via Digitalmars-d-learn
On Monday, 4 August 2025 at 20:02:48 UTC, Brother Bill wrote: I feel like I am going into the hornet's nest with this discussion. I have created a struct with some members, and want to have a parameterless constructor that sets the member values at run time. I know of no sane way to do that

struct parameterless constructor

2025-08-04 Thread Brother Bill via Digitalmars-d-learn
I feel like I am going into the hornet's nest with this discussion. I have created a struct with some members, and want to have a parameterless constructor that sets the member values at run time. I have seen things like @disable this(); and static opCall(), but don't quite understand them.

Re: Variables of struct and class types are called objects - discuss - spec

2025-08-04 Thread Nick Treleaven via Digitalmars-d-learn
On Monday, 4 August 2025 at 15:13:19 UTC, Nick Treleaven wrote: To complicate matters, the spec sometimes uses 'object' just to mean an instance of any type: If a pointer contains a null value, it is not pointing to a valid object. https://dlang.org/spec/type.html#pointers Note: git blame h

Re: Variables of struct and class types are called objects - discuss - spec

2025-08-04 Thread Nick Treleaven via Digitalmars-d-learn
On Monday, 4 August 2025 at 02:47:47 UTC, Jonathan M Davis wrote: The spec does use the term "aggregate type" to refer to classes, structs, interfaces, and unions, since they're all aggregates of values. However, from what I've seen, the term isn't used very often outside of the spec, and I don