27 Input/output library [input.output]

27.10 File systems [filesystems]

27.10.15 Filesystem operation functions [fs.op.funcs]

27.10.15.1 Absolute [fs.op.absolute]

path absolute(const path& p, const path& base = current_path());

Returns: An absolute path ([fs.def.absolute.path]) composed according to Table [tab:absolute.path].

Table 126absolute(const path&, const path&) return value
p.has_root_directory()!p.has_root_directory()
p.has_root_name() p 2.4in p.root_name()
/ absolute(base).root_directory()
/ absolute(base).relative_path()
/ p.relative_path()
!p.has_root_name() absolute(base).root_name() / p absolute(base) / p

Note: For the returned path, rp, rp.is_absolute() is true.  — end note ]

Throws: As specified in [fs.err.report].