operator<<,>>(std::filesystem::path)

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.

# Declarations

template< class CharT, class Traits >
friend std::basic_ostream<CharT,Traits>&
operator<<( std::basic_ostream<CharT,Traits>& os, const path& p );

(since C++17)

template< class CharT, class Traits >
friend std::basic_istream<CharT,Traits>&
operator>>( std::basic_istream<CharT,Traits>& is, path& p );

(since C++17)

# Parameters

# Example

#include <filesystem>
#include <iostream>
 
int main()
{
    std::cout << std::filesystem::current_path() << '\n';
    std::cout << std::filesystem::temp_directory_path() << '\n';
}

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 2989C++17allowed insertion of everything convertible to path in the presence of a using-directivemade hidden friend