# std::filesystem::directory_entry::operator=

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

Replaces the contents of the directory entry (path and cached attributes, if any) with the contents of other.

## Official Specification Summary (cppreference)

```cpp
directory_entry& operator=( const directory_entry& other ) = default; // (1) (since C++17)
directory_entry& operator=( directory_entry&& other ) noexcept = default; // (2) (since C++17)
```

Replaces the contents of the directory entry (path and cached attributes, if any) with the contents of `other`.

Both copy- and move-assignment operators for `directory_entry` are defaulted.

### Parameters

- `other` - other `directory_entry`

### Return value

`*this`

### Example

> Note: This section is incomplete Reason: no example

### See also

- [`assign`](https://en.cppreference.com/w/cpp/filesystem/directory_entry/assign): assigns contents (public member function)

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