|
-
January 25th, 2013, 05:04 AM
#8
Re: TR2 file library
 Originally Posted by D_Drmmr
Btw, it's a good thing that they didn't use + to append paths, because now you can write something like this:
Code:
path dir, subdir;
std::string stem, suffix, extension;
//...
path fullPath = dir / subdir / (stem + suffix + extension);
I don't see that '+' would be a problem in this case.
You are adding a path to a path and a string to a path. This would be surely be accomodated by overloads of the '+' operator.
Code:
std::path &operator + (const std::path& lhs, const std::path& rhs);
std::path &operator + (const std::path& lhs, const std::string& rhs);
std::path dir, subdir;
std::string stem, suffix, extension;
std::path fullPath = dir + subdir + (stem + suffix + extension);
"It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong."
Richard P. Feynman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|