cpp/filesystem/path/replace extension

Replaces the extension with or removes it when the default value of  is used.

Firstly, if this path has an, it is removed from the generic-format view of the pathname.

Then, a dot character is appended to the generic-format view of the pathname, if is not empty and does not begin with a dot character.

Then is appended as if by.