https://issues.dlang.org/show_bug.cgi?id=19638

Seb <greeen...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |greeen...@gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from Seb <greeen...@gmail.com> ---
>  so I will need to forward declare the variable however I cannot do this 
> because I do not know the type I should be using to declare because it has 
> been obscured by the use of auto in the demo.

Are you aware of e.g. `typeof`?

---
auto r = 10.iota;
---

is equal to:

---
typeof(10.iota) r;
...
r = 10.iota;
---

I will close this as invalid, because:

- for many functions in Phobos one doesn't even now the type
- `auto` is easier to read (less visible space)
- `auto` is smarter as you don't need to change anything if you refactor code
(also good for copy&paste examples)

I encourage you to look up Voldemort types
(https://wiki.dlang.org/Voldemort_types) and post to the Learn group for more
questions

--

Reply via email to