with the added bonus of being able to add "const" to that, for the benefit of the reader.
This is not relying on compiler implementation! Can you name one language that has strings that initialise to anything but a valid object containing an empty string?
This is not an obscure side-effect. This is like assuming "std::vector<int> v;" creates an empty vector, not a undefined-state vector container.
(I don't want someone coding C++ as if all objects are references. Coding in one language as if it were another is a well-known antipattern)
Read the whole comment. Still don't see nothing that invalidates my answer to "Can you name one language that has strings that initialise to anything but a valid object containing an empty string?".
std::string pad = descriptive_name_here(path);
with the added bonus of being able to add "const" to that, for the benefit of the reader.
This is not relying on compiler implementation! Can you name one language that has strings that initialise to anything but a valid object containing an empty string?
This is not an obscure side-effect. This is like assuming "std::vector<int> v;" creates an empty vector, not a undefined-state vector container.
(I don't want someone coding C++ as if all objects are references. Coding in one language as if it were another is a well-known antipattern)