Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::experimental::filesystem::operator/(std::experimental::filesystem::path)

      From cppreference.com
      <cpp‎ |experimental‎ |fs‎ |path
       
       
       
      Filesystem library
      Classes
      Functions
      File types
       
      path
      Member functions
      Path decomposition
      Non-member functions
      operator/
       
      Defined in header<experimental/filesystem>
      path operator/(const path& lhs,const path& rhs);
      (filesystem TS)

      Concatenates two paths. Effectively returnspath(lhs)/= rhs.

      Contents

      [edit]Parameters

      lhs, rhs - paths to concatenate

      [edit]Return value

      The result of path concatenation.

      [edit]Exceptions

      noexcept specification:  
      noexcept
        

      [edit]Example

      Run this code
      #include <experimental/filesystem>#include <iostream>namespace fs= std::experimental::filesystem; int main(){    fs::path p1="C:Users";std::cout<<"\"C:\" /\"Users\" == "<< p1<<'\n';    fs::path p2="batman";    fs::path p3= p1/ p2;// inserts fs::path::preferred_separator, '\' on Windowsstd::cout<<"\"C:\" /\"Users\" /\"batman\" == "<< p3<<'\n';}

      Output:

      "C:" / "Users" == "C:Users""C:" / "Users" / "batman" == "C:Users\batman"

      [edit]See also

      appends elements to the path
      (public member function)[edit]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/experimental/fs/path/operator_slash&oldid=154875"

      [8]ページ先頭

      ©2009-2026 Movatter.jp