regular types
A type is regular if it has following properties:
1- default constructible
2- copyable/movable
3- destructible
4- equality comparable
std::string
is a regular type:
std::string a; |
std::thread
is not because it’s designed to be not copyable.
Regular types and procedures are one of core concept of the STL. Most of the types are regular in STL, and designing yours so will make your type composable with them. Regular types are behave like the fundamental types, like an int, and doesn’t surprise the user. With object concepts regularity of the type can be checked on the fly:
|
More on: