Template:cpp/filesystem/error handling

The overload that does not take a parameter throws  on underlying OS API errors, constructed with  the OS error code as the error code argument. The overload taking a parameter sets it to the OS API error code if an OS API call fails, and executes  if no errors occur. Any overload not marked may throw  std if memory allocation fails.