Feature request: Path append operators for strings

Jonathan M Davis jmdavisProg at gmx.com
Tue Jul 2 12:56:01 PDT 2013


On Tuesday, July 02, 2013 21:46:26 TommiT wrote:
> How would you feel about adding the '/' binary operator and the
> '/=' assignment operator for strings, wstrings and dstrings? The
> operators would behave the same way as they do with
> boost::filesystem::path objects:
> 
> http://www.boost.org/doc/libs/1_54_0/libs/filesystem/doc/reference.html#path
> -appends
> 
> In short (and omitting some details) code such as:
> 
> string s = "C:\\Users" / "John";
> 
> ...would be the same as:
> 
> string s = "C:\\Users" ~ std.path.dirSeparator ~ "John";

That's what std.path.buildPath is for.

- Jonathan M Davis


More information about the Digitalmars-d mailing list