Re: Subrange type

2020-01-28 Thread Herbert via Digitalmars-d-learn
On Monday, 27 January 2020 at 22:05:57 UTC, Ali Çehreli wrote: On 1/27/20 1:15 PM, Herbert wrote: On Monday, 27 January 2020 at 20:15:33 UTC, Steven Schveighoffer wrote: On 1/27/20 3:06 PM, Herbert wrote: [...] D doesn't have a "Range" type like this. But you can use ranges of different typ

Re: Class member function with a Callback funtion parameter

2020-01-27 Thread Herbert via Digitalmars-d-learn
On Monday, 27 January 2020 at 22:20:42 UTC, H. S. Teoh wrote: On Mon, Jan 27, 2020 at 10:13:47PM +, Herbert via Digitalmars-d-learn wrote: On Monday, 27 January 2020 at 21:51:35 UTC, Adam D. Ruppe wrote: > On Monday, 27 January 2020 at 21:21:55 UTC, Herbert wrote: > > My project

Re: Class member function with a Callback funtion parameter

2020-01-27 Thread Herbert via Digitalmars-d-learn
On Monday, 27 January 2020 at 21:51:35 UTC, Adam D. Ruppe wrote: On Monday, 27 January 2020 at 21:21:55 UTC, Herbert wrote: My project does not allow dynamic memory. So I can't use delegates. delegates do not require dynamic memory. &obj.member doesn't allocate any new memory (it just points

Class member function with a Callback funtion parameter

2020-01-27 Thread Herbert via Digitalmars-d-learn
My project does not allow dynamic memory. So I can't use delegates. How can I declare a class member function with a callback function pointer?

Re: Subrange type

2020-01-27 Thread Herbert via Digitalmars-d-learn
On Monday, 27 January 2020 at 20:15:33 UTC, Steven Schveighoffer wrote: On 1/27/20 3:06 PM, Herbert wrote: How can I create a subrange type, for example ushort DiceValue {1 ... 6}? D doesn't have a "Range" type like this. But you can use ranges of different types by typing the literals. Note

Subrange type

2020-01-27 Thread Herbert via Digitalmars-d-learn
How can I create a subrange type, for example ushort DiceValue {1 .. 6}?

Public constants and types in class

2020-01-27 Thread Herbert via Digitalmars-d-learn
How can a class provide it's users with named constants, enums, types, structs and not just member functions?