operator==,!= (std::allocator)
      From cppreference.net
     
     
     
        
         C++
        
        
         
          
           
          
          
         
        
       
       
        
         Memory management library
        
        
         
          
           
            
          
          
          
         
        
       
       | 
 | 
 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
        
         
          std::allocator
         
        
        
         
          
           
            
          
          
          
         
        
       
       | Member functions | ||||
| 
                
                 
                  
                   (until C++20)
                  
                 
                
                | ||||
| 
                
                 
                  
                   (C++23)
                  
                 
                
                | ||||
| 
                
                 
                  
                   (until C++20)
                  
                 
                
                | ||||
| 
                
                 
                  
                   (until C++20)
                  
                 
                
                | ||||
| 
                
                 
                  
                   (until C++20)
                  
                 
                
                | ||||
| Non-member functions | ||||
| 
                
                 
                  
                   operator==
                  
                  
                   operator!=
                  
                 
                
                
                
                 
                 
                 
                  
                   (until C++20)
                  
                 
                
                | 
| (1) | ||
| 
           
           
           
            
             template
            
            
             <
            
            
             class
            
            T1,
            
             class
            
            T2
            
             >
            
             bool operator == ( const allocator < T1 > & lhs, const allocator < T2 > & rhs ) throw ( ) ; | (C++11 前) | |
| 
           
            
             template
            
            
             <
            
            
             class
            
            T1,
            
             class
            
            T2
            
             >
            
             bool operator == ( const allocator < T1 > & lhs, const allocator < T2 > & rhs ) noexcept ; | (C++11 起) (C++20 前) | |
| 
           
            
             template
            
            
             <
            
            
             class
            
            T1,
            
             class
            
            T2
            
             >
            
             
             
              constexpr
             
             
              bool
             
              | (C++20 起) | |
| (2) | ||
| 
           
           
           
            
             template
            
            
             <
            
            
             class
            
            T1,
            
             class
            
            T2
            
             >
            
             bool operator ! = ( const allocator < T1 > & lhs, const allocator < T2 > & rhs ) throw ( ) ; | (C++11 前) | |
| 
           
            
             template
            
            
             <
            
            
             class
            
            T1,
            
             class
            
            T2
            
             >
            
             bool operator ! = ( const allocator < T1 > & lhs, const allocator < T2 > & rhs ) noexcept ; | (C++11 起) (C++20 前) | |
比较两个默认分配器。由于默认分配器是无状态的,因此两个默认分配器始终相等。
       
        1)
       
       返回
       
        
         
          true
         
        
       
       。
      
      
       
        2)
       
       返回
       
        
         
          false
         
        
       
       。
      
      | 
           | (since C++20) | 
参数
| lhs, rhs | - | 用于比较的默认分配器 | 
返回值
       
        1)
       
       
        
         
          true
         
        
       
      
      
       
        2)
       
       
        
         
          false