std::copyable_function:: copyable_function
| 
           
           
            copyable_function
            
             (
            
            
             )
            
            
             noexcept
            
            
             ;
            
           
           
          | 
         (1) | (seit C++26) | 
| 
           
           
            copyable_function
            
             (
            
            
             
              std::
              
               nullptr_t
              
             
            
            
             )
            
            
             noexcept
            
            
             ;
            
           
           
          | 
         (2) | (seit C++26) | 
| 
           
           
            copyable_function
            
             (
            
            
             const
            
            copyable_function
            
             &
            
            other
            
             )
            
            
             ;
            
           
           
          | 
         (3) | (seit C++26) | 
| 
           
           
            copyable_function
            
             (
            
            copyable_function
            
             &&
            
            other
            
             )
            
            
             noexcept
            
            
             ;
            
           
           
          | 
         (4) | (seit C++26) | 
| 
           
           
            
             template
            
            
             <
            
            
             class
            
            F
            
             >
            
             
         copyable_function ( F && f ) ;  | 
         (5) | (seit C++26) | 
| 
           
           
            
             template
            
            
             <
            
            
             class
            
            T,
            
             class
            
            ...
            
             CArgs
            
            
             >
            
             
         explicit copyable_function ( std:: in_place_type_t < T > , CArgs && ... args ) ;  | 
         (6) | (seit C++26) | 
| 
           
           
            
             template
            
            
             <
            
            
             class
            
            T,
            
             class
            
            U,
            
             class
            
            ...
            
             CArgs
            
            
             >
            
             
         
             
              explicit
             
             copyable_function
             
              (
             
             
              
               std::
               
                in_place_type_t
               
              
             
             
              <
             
             T
             
              >
             
             ,
               | 
         (7) | (seit C++26) | 
       Erstellt eine neue
       
        std::copyable_function
       
       .
      
        std::copyable_function
       
       .
      
        std::copyable_function
       
       , dessen Ziel eine Kopie des Ziels von
       
        
         other
        
       
       ist. Andernfalls konstruiert er ein leeres
       
        std::copyable_function
       
       , falls
       
        
         other
        
       
       leer ist.
      
        std::copyable_function
       
       , dessen Ziel das von
       
        
         other
        
       
       ist.
       
        
         other
        
       
       befindet sich nach der Move-Konstruktion in einem gültigen, aber unspezifizierten Zustand.
      
        VT
       
       gleich
       
        
         
          
           std::
           
            decay_t
           
          
         
         
          <
         
         F
         
          >
         
        
       
       . Falls
       
        
         f
        
       
       ein null-Funktionszeiger, ein null-Zeiger auf Element oder ein leeres
       
        std::copyable_function
       
       (kann eine beliebige andere Spezialisierung sein) ist, dann wird ein leeres
       
        std::copyable_function
       
       konstruiert. Andernfalls wird ein
       
        std::copyable_function
       
       konstruiert, dessen Ziel vom Typ
       
        VT
       
       ist und direkt-nicht-List-initialisiert wird mit
       
        
         
          
           std::
           
            forward
           
          
         
         
          <
         
         F
         
          >
         
         
          (
         
         f
         
          )
         
        
       
       .
       - 
         Diese Überladung nimmt nur dann an der Überladungsauflösung teil, wenn
         
VTweder gleichcopyable_functionnoch eine Spezialisierung von std::in_place_type_t ist, und /*is-callable-from*/ < VT > (siehe unten) true ist. - Das Programm ist fehlerhaft, wenn std:: is_constructible_v < VT, F > oder std:: is_copy_constructible_v < VT > nicht true ist.
 
        VT
       
       definiert als
       
        
         
          
           std::
           
            decay_t
           
          
         
         
          <
         
         T
         
          >
         
        
       
       . Konstruiert ein
       
        std::copyable_function
       
       , dessen Zielobjekt vom Typ
       
        VT
       
       ist und direkt-nicht-List-initialisiert wird mit
       
        
         
          
           std::
           
            forward
           
          
         
         
          <
         
         CArgs
         
          >
         
         
          (
         
         args
         
          )
         
         ...
        
       
       .
       - Diese Überladung nimmt nur dann an der Überladungsauflösung teil, wenn sowohl std:: is_constructible_v < VT, CArgs... > als auch /*is-callable-from*/ < VT > (siehe unten) true sind.
 - 
         Das Programm ist fehlerhaft, wenn
         
VTnicht dem selben Typ wieTentspricht oder std:: is_copy_constructible_v < VT > nicht true ist. 
        VT
       
       definiert als
       
        
         
          
           std::
           
            decay_t
           
          
         
         
          <
         
         T
         
          >
         
        
       
       . Konstruiert ein
       
        std::copyable_function
       
       , dessen Zielobjekt vom Typ
       
        VT
       
       ist und direkt-nicht-List-initialisiert wird mit
       
        
         il,
         
          
           std::
           
            forward
           
          
         
         
          <
         
         CArgs
         
          >
         
         
          (
         
         args
         
          )
         
         ...
        
       
       .
       - Diese Überladung nimmt nur dann an der Überladungsauflösung teil, wenn sowohl std:: is_constructible_v < VT, std:: initializer_list < U > & , CArgs... > als auch /*is-callable-from*/ < VT > (siehe unten) true sind.
 - 
         Das Programm ist fehlerhaft, wenn
         
VTnicht denselben Typ wieTbesitzt oder std:: is_copy_constructible_v < VT > nicht true ist. 
       Für Konstruktoren
       
        (5-7)
       
       ist das Verhalten undefiniert, es sei denn
       
        VT
       
       erfüllt sowohl die
       
        
         Destructible
        
       
       - als auch die
       
        
         CopyConstructible
        
       
       -Anforderungen.
      
       Die Konstante
       
        
         
          /*is-callable-from*/
         
         
          <
         
         VT
         
          >
         
        
       
       hängt von
       
        cv
       
       ,
       
        ref
       
       und
       
        noex
       
       im Template-Parameter von
       
        std::copyable_function
       
       wie folgt ab:
      
| cv ref noexcept ( noex ) | /*aufrufbar-von*/ < VT > | 
| noexcept ( false ) | 
         
          
           
            
             std::
             
              is_invocable_r_v
             
            
           
           
            <
           
           R, VT, Args...
           
            >
           
           
            &&
           
            std:: is_invocable_r_v < R, VT & , Args... >  | 
       
| noexcept ( true ) | 
         
          
           
            
             std::
             
              is_nothrow_invocable_r_v
             
            
           
           
            <
           
           R, VT, Args...
           
            >
           
           
            &&
           
            std:: is_nothrow_invocable_r_v < R, VT & , Args... >  | 
       
| const noexcept ( false ) | 
         
          
           
            
             std::
             
              is_invocable_r_v
             
            
           
           
            <
           
           R,
           
            const
           
           VT, Args...
           
            >
           
           
            &&
           
            std:: is_invocable_r_v < R, const VT & , Args... >  | 
       
| const noexcept ( true ) | 
         
          
           
            
             std::
             
              is_nothrow_invocable_r_v
             
            
           
           
            <
           
           R,
           
            const
           
           VT, Args...
           
            >
           
           
            &&
           
            std:: is_nothrow_invocable_r_v < R, const VT & , Args... >  | 
       
| & noexcept ( false ) | std:: is_invocable_r_v < R, VT & , Args... > | 
| & noexcept ( true ) | std:: is_nothrow_invocable_r_v < R, VT & , Args... > | 
| const & noexcept ( false ) | std:: is_invocable_r_v < R, const VT & , Args... > | 
| const & noexcept ( true ) | std:: is_nothrow_invocable_r_v < R, const VT & , Args... > | 
| && noexcept ( false ) | std:: is_invocable_r_v < R, VT, Args... > | 
| && noexcept ( true ) | std:: is_nothrow_invocable_r_v < R, VT, Args... > | 
| const && noexcept ( false ) | std:: is_invocable_r_v < R, const VT, Args... > | 
| const && noexcept ( true ) | std:: is_nothrow_invocable_r_v < R, const VT, Args... > | 
         Inhaltsverzeichnis | 
       
Parameter
| other | - | 
         ein weiteres
         
          std::copyable_function
         
         zum Kopieren oder Verschieben
         | 
       
| f | - | eine Funktion oder ein Callable Objekt zum Einhüllen | 
| args | - | Argumente zum Konstruieren des Zielobjekts | 
| il | - | std::initializer_list zum Konstruieren des Zielobjekts | 
Exceptions
        VT
       
       ein Funktionszeigertyp oder eine Spezialisierung von
       
        
         std::reference_wrapper
        
       
       ist.
      Beispiel
| 
         Dieser Abschnitt ist unvollständig
          Grund: Kein Beispiel  | 
       
Siehe auch
         Konstruiert eine neue
         
          std::function
         
         Instanz
         (öffentliche Elementfunktion von 
           std::function<R(Args...)>
          
          )
         
         | 
       |
         Konstruiert ein neues
         
          std::move_only_function
         
         Objekt
         (öffentliche Elementfunktion von 
           std::move_only_function
          
          )
         
         |