Concepts library

Curated hub for the C++20 concepts library: core object concepts, comparison and relation concepts, callable concepts, and practical constraint-building routes.

The concepts library provides named constraints for templates and generic algorithms. These concepts let you express what types and operations a template expects, turning long substitution failures into explicit requirements and clearer overload selection.

This page is about the standardized `` library concepts. Keep the broader template language mechanics in templates and the range-specific concept ecosystem in ranges.

# Start Here

Type identity and convertibility

Start here when your constraint is about two types matching, converting, or sharing a common type/reference.

Object lifecycle concepts

Use this route for construction, assignment, moving, copying, destructibility, and “regular type” style requirements.

Comparison and ordering

Choose this route when the key question is equality, total ordering, or relation/predicate semantics.

Callable and predicate concepts

Use this route for callability, predicates, and function-object style constraints in algorithms and generic code.

Fundamental category concepts

Start here when you need coarse-grained categories such as integral, floating-point, signed, or unsigned types.

Inheritance and swapping

Use this route for hierarchy relationships, assignability, and operations like swapping that often appear in generic APIs.

# Quick Map

If you need to say...Start withTypical follow-ups
“These two types must be the same or interoperate through a common type”same_asconvertible_to, common_with, common_reference_with
“This type must be movable/copyable/regular”movable or regularcopyable, semiregular, destructible
“This callable must be invocable and maybe return a predicate/relation”invocablepredicate, relation, equivalence_relation
“These values must support equality or ordering”equality_comparable or totally_orderedstrict_weak_order, relation
“The type belongs to a broad arithmetic category”integral or floating_pointsigned_integral, unsigned_integral
“The type participates in inheritance or assignment relationships”derived_from or assignable_fromswappable, constructible_from

# Practical Routes

I am writing constrained templates

Use templates and constraints pages when your main problem is `requires`, constraint normalization, or template syntax around these concepts.

I need a “regular value-like type” constraint

Start here when you want a concept that implies a type behaves predictably like an ordinary value.

I need callable or predicate constraints

Start here for algorithm-style callability, predicate, and relation constraints.

I probably need ranges concepts instead

If the requirement is about iteration, views, or range-based algorithm participation, the ranges hub is usually the better first stop.

# Boundary Lines

If you actually need...Go here
The syntax and semantics of constrained templates, `requires` expressions, or constraint satisfactionconstraints, requires, templates
Iterator or range participation concepts rather than the `` library setranges, iterator
Older named requirements instead of standardized C++20 conceptsNamed requirements
Type traits or detection utilities rather than named concepts<type_traits>, type support