# std::basic_ofstream<CharT,Traits>::native_handle

> C++ Atlas: `cppatlas.com/w/cpp/io/basic_ofstream/native_handle` | Source: https://en.cppreference.com/w/cpp/io/basic_ofstream/native_handle | Domain: Input/output | Standards: C++26

Returns the implementation defined underlying handle associated with basic_filebuf. The behavior is undefined if is_open() is false.

## Official Specification Summary (cppreference)

```cpp
native_handle_type native_handle() const noexcept; // (since C++26)
```

Returns the implementation defined underlying handle associated with `basic_filebuf`. The behavior is undefined if `is_open()` is `false`.

### Return value

`rdbuf()->native_handle()`

### Notes

| Feature-test macro | Value | Std | Feature |
| --- | --- | --- | --- |
| `__cpp_lib_fstream_native_handle` | `202306L` | (C++26) | native handles support |

### Example

> Note: This section is incomplete Reason: example

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