std::experimental::filesystem::path::remove_filename

From cppreference.com
< cpp‎ | experimental‎ | fs‎ | path
path& remove_filename()
(1) (filesystem TS)

Removes a single filename component.

Contents

[edit] Parameters

(none)

[edit] Return value

*this

[edit] Exceptions

(none)

[edit] Example

#include <filesystem>
#include <iostream>
 
int main()
{
    std::cout << std::fs::path("/foo").remove_filename() << '\n';
    std::cout << std::fs::path("/").remove_filename() << '\n';
}

Output:

/

[edit] See also