Creating a new type, to get strong-ish type checking and restrict usage to certain operations, using struct perhaps
Cecil Ward via Digitalmars-d-learn Fri, 21 Jul 2017 11:51:06 -0700
I was think about how to create a new type that holds packed bcd
values, of a choice of widths, that must fit into a uint32_t or a
uint64_t (not really long multi-byte objects). I am not at all
sure how to do it. I thought about using a templated struct to
simply wrap a uint of a chosen width, and perhaps use alias this
to make things nicer.
- Creating a new type, to get strong... Cecil Ward via Digitalmars-d-learn
- Re: Creating a new type, to g... Moritz Maxeiner via Digitalmars-d-learn
- Re: Creating a new type, to g... Ali Çehreli via Digitalmars-d-learn
- Re: Creating a new type, to g... Cecil Ward via Digitalmars-d-learn
- Re: Creating a new type, ... Cecil Ward via Digitalmars-d-learn
- Re: Creating a new ty... Moritz Maxeiner via Digitalmars-d-learn
- Re: Creating a new type, ... Moritz Maxeiner via Digitalmars-d-learn