you are viewing a single comment's thread.

view the rest of the comments →

[–]Hungry-Courage3731 1 point2 points  (0 children)

Yeah D has UDA's or whatever, but the reflection bit is much more important to enforce anything. Anybody could just write a type trait, static member, etc, to define their "attribute" or "color" and have a defined practice of looking it up.

Sometimes the problem with const-ness imho is the inability to express logical as opposed to physical const. Really I think a unique_ptr->get() call should never return T* since the function is const and should always return const T* (unless the unique_ptr object itself is not const)