Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread tcak via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 10:50:04 UTC, Rikki Cattermole wrote: On 01/12/15 11:44 PM, Ozan wrote: Hi Let's say we have an enum like enum SomethingAboutChristmas { SantaClaus, Angel, Tree } and want to use it in a function like void goingChristmas(SomethingAboutChristmas enum

Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread tcak via Digitalmars-d-learn
On Tuesday, 1 December 2015 at 13:03:37 UTC, tcak wrote: On Tuesday, 1 December 2015 at 10:50:04 UTC, Rikki Cattermole wrote: [...] This is like: Q) I want to write an OS. How? A) Write in assembly. What Ozan says is logical. Compiler should assume it in that way normally. I have thorough

Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread Daniel Kozak via Digitalmars-d-learn
V Tue, 01 Dec 2015 10:44:06 + Ozan via Digitalmars-d-learn napsáno: > Hi > > Let's say we have an enum like > > enum SomethingAboutChristmas { >SantaClaus, >Angel, >Tree > } > > and want to use it in a function like > >void goingChristmas(SomethingAboutChristmas enumvalue)

Re: Using enums as function parameters (in a minimized way)

2015-12-01 Thread Rikki Cattermole via Digitalmars-d-learn
On 01/12/15 11:44 PM, Ozan wrote: Hi Let's say we have an enum like enum SomethingAboutChristmas { SantaClaus, Angel, Tree } and want to use it in a function like void goingChristmas(SomethingAboutChristmas enumvalue) it works fine like following goingChristmas(SomethingAbout

Using enums as function parameters (in a minimized way)

2015-12-01 Thread Ozan via Digitalmars-d-learn
Hi Let's say we have an enum like enum SomethingAboutChristmas { SantaClaus, Angel, Tree } and want to use it in a function like void goingChristmas(SomethingAboutChristmas enumvalue) it works fine like following goingChristmas(SomethingAboutChristmas.Tree) I prefer to use a short