Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      Named Requirements

      From cppreference.com
      <cpp
       
       
      C++ named requirements
       

      Thenamed requirements listed on this page are the named requirements used in the normative text of the C++ standard to define the expectations of the standard library.

      The burden to ensure that library templates are instantiated with template arguments that satisfy these requirements is on the programmer. Failure to do so may result in very complex compiler diagnostics.

      Some of these requirements are formalized in C++20 using theconcepts language feature.

      Contents

      Basic

      specifies that an object of the type can be default constructed
      (named requirement)
      specifies that an object of the type can be constructed from rvalue
      (named requirement)
      specifies that an object of the type can be constructed from lvalue
      (named requirement)
      specifies that an object of the type can be assigned from rvalue
      (named requirement)
      specifies that an object of the type can be assigned from lvalue
      (named requirement)
      specifies that an object of the type can be destroyed
      (named requirement)

      Type properties

      Note: the standard does not define named requirements with names specified in this subcategory.
      These are type categories defined by the core language. They are included here as named requirements only for consistency.
      object types that are not array types or class types
      (named requirement)
      (deprecated in C++20)
      POD (Plain Old Data) types, compatible with Cstruct
      (named requirement)
      objects of these types can maintain their values after copying their underlying bytes
      (named requirement)
      (C++11)(deprecated in C++26)
      objects of these types can be trivially constructed and copied
      (named requirement)
      these types are useful for communicating with code written in other programming languages
      (named requirement)
      objects of these types can be implicitly created, and their lifetimes can be implicitly started
      (named requirement)

      Library-wide

      boolean operations (operator&&,operator||, andoperator!) have usual semantics
      (named requirement)
      operator== is an equivalence relation
      (named requirement)
      operator< is a strict weak ordering relation
      (named requirement)
      can be swapped with an unqualified non-member function callswap()
      (named requirement)
      aLegacyIterator that dereferences to aSwappable type
      (named requirement)
      a pointer-like type supporting a null value
      (named requirement)
      (C++11)
      aFunctionObject that for inputs with different values has a low probability of giving the same output
      (named requirement)
      a class type that contains allocation information
      (named requirement)
      an object that can be called with the function call syntax
      (named requirement)
      a type for which the invoke operation is defined
      (named requirement)
      aFunctionObject that returns a value convertible tobool for one argument without modifying it
      (named requirement)
      aFunctionObject that returns a value convertible tobool for two arguments without modifying them
      (named requirement)
      aBinaryPredicate that establishes an ordering relation
      (named requirement)

      Container

      data structure that allows element access using iterators
      (named requirement)
      container using bidirectional iterators
      (named requirement)
      container using an allocator
      (named requirement)
      container with elements stored linearly
      (named requirement)
      container with elements stored at adjacent memory addresses
      (named requirement)
      container that stores elements by associating them to keys
      (named requirement)
      container that stores elements stored in buckets by associating them to keys
      (named requirement)
      Container element
      element can be default-constructed in uninitialized storage
      (named requirement)
      element can be copy-constructed in uninitialized storage
      (named requirement)
      element can be move-constructed in uninitialized storage
      (named requirement)
      element can be constructed in uninitialized storage
      (named requirement)
      (C++11)
      element can be destroyed using an allocator
      (named requirement)

      Iterator

      general concept to access data within some data structure
      (named requirement)
      iterator that can be used to read data
      (named requirement)
      iterator that can be used to write data
      (named requirement)
      iterator that can be used to read data multiple times
      (named requirement)
      iterator that can be both incremented and decremented
      (named requirement)
      iterator that can be advanced in constant time
      (named requirement)
      iterator to contiguously-allocated elements
      (named requirement)
      iterator that can be used during constant expression evaluation
      (named requirement)

      Stream I/O functions

      a stream input function that does not skip leading whitespace and counts the processed characters
      (named requirement)
      a stream input function that skips leading whitespace
      (named requirement)
      a basic stream output function
      (named requirement)
      a stream output function that sets failbit on errors and returns a reference to the stream
      (named requirement)

      Formatters

      abstracts formatting operations for a given formatting argument type and character type
      (named requirement)
      (C++20)
      defines functions used by theformatting library
      (named requirement)

      Random Number Generation

      consumes a sequence of integers and produces a sequence of 32-bit unsigned values
      (named requirement)
      returns uniformly distributed random unsigned integers
      (named requirement)
      a deterministicUniformRandomBitGenerator, defined by the seed
      (named requirement)
      aRandomNumberEngine that transforms the output of anotherRandomNumberEngine
      (named requirement)
      returns random numbers distributed according to a given mathematical probability density function
      (named requirement)

      Concurrency

      provides exclusive ownership semantics for execution agents (i.e. threads)
      (named requirement)
      (C++11)
      aBasicLockable that supports attempted lock acquisition
      (named requirement)
      aLockable that supports timed lock acquisition
      (named requirement)
      provides shared ownership semantics for execution agents (i.e. threads)
      (named requirement)
      aSharedLockable that supports timed lock acquisition
      (named requirement)
      (C++11)
      aLockable that protects against data races and sequentially consistent synchronization
      (named requirement)
      (C++11)
      aTimedLockable that protects against data races and sequentially consistent synchronization
      (named requirement)
      aMutex that supports shared ownership semantics
      (named requirement)
      aTimedMutex that supports shared ownership semantics
      (named requirement)

      Ranges

      aFunctionObject that creates arange adaptor from aviewable_range and additional arguments
      (named requirement)
      aFunctionObject that supports the pipe operator
      (named requirement)

      Multidimensional View Customization

      controls the mapping of multidimensional index inmdspan
      (named requirement)
      a policy that holdsLayoutMapping requirements
      (named requirement)
      a policy that controls access to data handle inmdspan
      (named requirement)

      Other

      describes a property of a type
      (named requirement)
      describes a relationship between two types
      (named requirement)
      modifies a property of a type
      (named requirement)
      (C++11)
      aggregates a duration, a time point, and a function to get the current time point
      (named requirement)
      aClock that does not throw exceptions
      (named requirement)
      defines types and functions for a character type
      (named requirement)
      bitset, integer, or enumeration
      (named requirement)
      a type for which initialization is effectively equal to assignment
      (named requirement)
      defines types and functions used by theregular expressions library
      (named requirement)
      a type with constexpr constructor
      (named requirement)
      This section is incomplete
      Reason: Any other missing requirement?
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/named_req&oldid=178049"

      [8]ページ先頭

      ©2009-2025 Movatter.jp