29 Input/output library [input.output]

29.11 File systems [filesystems]

29.11.14 Filesystem operation functions [fs.op.funcs]

29.11.14.38 Temporary directory path [fs.op.temp.dir.path]

path temp_directory_path(); path temp_directory_path(error_code& ec);
Let p be an unspecified directory path suitable for temporary files.
Effects: If exists(p) is false or is_­directory(p) is false, an error is reported ([fs.err.report]).
Returns: The path p.
The signature with argument ec returns path() if an error occurs.
Throws: As specified in [fs.err.report].
[Example
:
For POSIX-based operating systems, an implementation might return the path supplied by the first environment variable found in the list TMPDIR, TMP, TEMP, TEMPDIR, or if none of these are found, "/tmp".
For Windows-based operating systems, an implementation might return the path reported by the Windows GetTempPath API function.
— end example
]