|
|
|
|
|
by candiddevmike
1892 days ago
|
|
I like the second option (&int(3)) the most personally, as I find myself occasionally defining a bunch of variables before I can use them as pointers in structs. It looks and feels a lot cleaner to use this vs having new everywhere. |
|
I tend to not declare variables when the pointer is used deep into a struct because I find the back-and-forth in the editor to be bad. I usually resort to a pointer to an inline anonymous function, e.g.:
It's ugly and verbose but after seeing it 2 or 3 times you immediately know what it's about the next time.