std::movable(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

πŸ’– std::movable(3) πŸ’–

okay so bestie, this is page std::movable(3) from the C++ Standard Libary manual, and we're doing concepts today. no cap. πŸ’…


πŸŽ€ NAME πŸŽ€

std::movable - std::movable

that's the name. iconic, honestly. ✨

🌈 Synopsis 🌈

Defined in header <concepts> β€” yes bestie, that's where it lives. πŸ¦‹

Defined in header <concepts>
template< class T >

concept movable =
    std::is_object_v<T> &&          (since C++20)
    std::move_constructible<T> &&
    std::assignable_from<T&, T> &&

    std::swappable<T>;

so what is this actually saying? The concept movable<T> specifies that T is an object type that can be moved β€” that is, it can be move constructed, it can be move assigned, and lvalues of type T can be swapped. literally the whole "can I move this around?" vibe check. 😭πŸ”₯

πŸ‘€ See also πŸ‘€

  • copyable β€” specifies that an object of a type can be copied, moved, and swapped. (C++20) (concept) 🫢

mwah πŸ’‹ source: http://cppreference.com, version and date: 2024.06.10, page: std::movable(3). that's the footer tea, bestie β€” bye! πŸŒΈπŸ¦‹

πŸ“¦ where this page comes from