Performs stream input or output on the path p
. std::quoted
is used so that spaces do not cause truncation when later read by stream input operator.
These function templates are not visible to ordinary unqualified or qualified lookup , and can only be found by argument-dependent lookup when std::filesystem::path
is an associated class of the arguments. This prevents undesirable conversions in the presence of a using namespace std::filesystem;
using-directive.
os | - | stream to perform output on |
is | - | stream to perform input on |
p | - | path to insert or extract |
os
is
(none).
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR | Applied to | Behavior as published | Correct behavior |
---|---|---|---|
LWG 2989 | C++17 | allowed insertion of everything convertible to path in the presence of a using-directive | made hidden friend |
First version |
---|
Second version |
#include <iostream> #include <filesystem> int main() { std::cout << std::filesystem::current_path() << '\n'; }
Possible output:
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
http://en.cppreference.com/w/cpp/filesystem/path/operator_ltltgtgt