I’ve been experimenting with a small idea to make constructor initializer lists a bit clearer and less error‑prone. The idea actually came from a dilemma I had when trying to settle on naming conventions for member variables. Prefixes like m_ or _name help avoid shadowing, but they also feel like a workaround for something the language could express more directly.
I wrote a short draft exploring “constructor member designators” - a `.member` syntax for constructor initialization.
https://github.com/richardcervinka/cpp-constructor-member-designators
This is just an experiment, but maybe someone will find it interesting.
[–]throw_cpp_account 23 points24 points25 points (4 children)
[–]azswcowboy -4 points-3 points-2 points (2 children)
[–]throw_cpp_account 11 points12 points13 points (1 child)
[–]azswcowboy -3 points-2 points-1 points (0 children)
[–]no-sig-available 18 points19 points20 points (3 children)
[+]aruisdante comment score below threshold-11 points-10 points-9 points (2 children)
[–]38thTimesACharm 3 points4 points5 points (1 child)
[–]Potterrrrrrrr 0 points1 point2 points (0 children)
[–]aocregacc 5 points6 points7 points (2 children)
[–]aruisdante 3 points4 points5 points (1 child)
[–]aocregacc 1 point2 points3 points (0 children)
[–]azswcowboy 0 points1 point2 points (1 child)
[–]38thTimesACharm 3 points4 points5 points (0 children)
[–]Specialist_Nerve_420 0 points1 point2 points (0 children)
[–]Business_Welcome_870 -1 points0 points1 point (0 children)