
12 Feb
2006
12 Feb
'06
11:48 a.m.
Ion GaztaƱaga wrote:
Like I've said, optional provides two-phase initialization, which is something you want to avoid, no? An empty optional is clearly "half-baked".
Um, no, not really. Optional is a value type object. Even after default construction, it has a valid and usable state - it contains nothing. Due to the purpose and design of optional, this makes perfect sense. A shared memory that contains nothing, on the other hand, does not make sense. Sebastian Redl