Namespaces
Variants
Actions

std::filesystem::absolute

From cppreference.com
 
 
 
Defined in header <filesystem>
path absolute( const std::filesystem::path& p );
(1) (since C++17)
path absolute( const std::filesystem::path& p, std::error_code& ec );
(2) (since C++17)

Returns a path referencing the same file system location as p, for which filesystem::path::is_absolute() is true.

2) This non-throwing overload returns default-constructed path if an error occurs.

Contents

[edit] Parameters

p - path to convert to absolute form
ec - out-parameter for error reporting in the non-throwing overload

[edit] Return value

Returns an absolute (although not necessarily canonical) pathname referencing the same file as p.

[edit] Exceptions

Any overload not marked noexcept may throw