title: How to reset filesystem::current_path() in C++17?
body: <p>I am writing a C++ program in which I change the working directory with <code>std::filesystem::current_path(working_directory)</code>, where <code>working_directory</code> is a string. Is there a good way to, later in the program, reset the working directory to its original value? I understand that one solution would be to use a variable <code>string initial_directory = std::filesystem::current_path()</code> before I change the working directory and then later reset it with <code>std::filesystem::current_path(initial_directory)</code>, but I feel like there should be a more elegant solution.</p>
  <p>Thanks!</p>