std::filesy...::root_path(3)
πΈ NAME πΈ
The manual page std::filesy...::root_path(3) is from the C++ Standard Libary (their spelling, not mine π), and itβs all about std::filesystem::path::root_path. The original name line is literally std::filesystem::path::root_path - std::filesystem::path::root_path, which is iconic in a deeply unhinged way. π
β¨ Synopsis β¨
path root_path() const; (since C++17)
Returns the root path of the path. If the path does not include root path, returns path().
Effectively returns root_name() / root_directory().
π«Ά Parameters π«Ά
(none) β zero, nada, no arguments. Itβs giving low-maintenance icon. β¨
π Return value π
The root path of the path. Thatβs the whole vibe. π
π Exceptions π
May throw implementation-defined exceptions. So likeβ¦ your implementation gets to decide the drama level, bestie. π
π» Example π»
The page says // Run this code right before the snippet, so hereβs the exact code:
#include <filesystem>
#include <iostream>
namespace fs = std::filesystem;
int main()
{
std::cout << "Current root path is: " <<
fs::current_path().root_path() << '\n';
}
Possible output:
Current root path is: "C:\"
π See also π
root_nameβ returns the root-name of the path, if present (public member function)root_directoryβ returns the root directory of the path, if present (public member function)
Thatβs the tea from http://cppreference.com, version/date 2024.06.10, page std::filesy...::root_path(3) β periodt. πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms