For last couple of days I have been experimenting the behavior of few of the functions of filesystem
and experimental/filesystem
library.
Note: I ran the code on https://godbolt.org/
below is the code snippet with its output
1. experimental/filesystem
#include <iostream>
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
int main()
{
auto p = fs::path("//net");
std::cout<<"p = " << p
<<"\np.root_name= "<< p.root_name()
<<"\nand p.root_Dir= "<< p.root_directory()
<<"\np.is_absolute= "<<p.is_absolute()<<std::endl;
}
output:
p = "//net"
p.root_name= "//net"
and p.root_Dir= ""
p.is_absolute= 0
#include <iostream>
#include <filesystem>
namespace fs = std::filesystem;
int main()
{
auto p = fs::path("//net");
std::cout<<"p = " << p
<<"\np.root_name= "<< p.root_name()
<<"\nand p.root_Dir= "<< p.root_directory()
<<"\np.is_absolute= "<<p.is_absolute()<<std::endl;
}
output:
p = "//net"
p.root_name= ""
and p.root_Dir= "/"
p.is_absolute= 1
Is there any way to look into the implementation of these functions ?