# std::basic_string<CharT,Traits,Allocator>::~basic_string

> C++ Atlas: `cppatlas.com/w/cpp/string/basic_string/~basic_string` | Source: https://en.cppreference.com/w/cpp/string/basic_string/~basic_string | Domain: Strings | Standards: C++20

Destructs the basic_string. The destructors of the elements are called and the used storage is deallocated.

## Official Specification Summary (cppreference)

```cpp
~basic_string(); // (constexpr since C++20)
```

Destructs the `basic_string`. The destructors of the elements are called and the used storage is deallocated.

### Complexity

Typically constant (formally linear).

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