# std::filesystem::path::is_absolute,is_relative

> C++ Atlas: `cppatlas.com/w/cpp/filesystem/path/is_absrel` | Source: https://en.cppreference.com/w/cpp/filesystem/path/is_absrel | Domain: Filesystem | Standards: C++17

Checks whether the path is absolute or relative. An absolute path is a path that unambiguously identifies the location of a file without reference to an additional starting location.

## Official Specification Summary (cppreference)

```cpp
bool is_absolute() const; // (1) (since C++17)
bool is_relative() const; // (2) (since C++17)
```

Checks whether the path is absolute or relative. An absolute path is a path that unambiguously identifies the location of a file without reference to an additional starting location. The first version returns `true` if the path, in native format, is absolute, `false` otherwise; the second version the other way round.

### Parameters

(none)

### Return value

1) `true` if the path is absolute, `false` otherwise.

2) `false` if the path is absolute, `true` otherwise.

### Exceptions

May throw implementation-defined exceptions.

### Notes

The path `"/"` is absolute on a POSIX OS, but is relative on Windows.

### See also

- [`absolute`](https://en.cppreference.com/w/cpp/filesystem/absolute) (C++17): composes an absolute path (function)

---
Attribution: content from https://en.cppreference.com/w/cpp/filesystem/path/is_absrel (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.