File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,22 @@ namespace mongo {
106106            init (bsonData);
107107        }
108108
109+ #if  __cplusplus >= 201103L
110+         /* * Move construct a BSONObj */ 
111+         BSONObj (BSONObj&& other)
112+             : _objdata(std::move(other._objdata))
113+             , _holder(std::move(other._holder)) {
114+             other._objdata  = BSONObj ()._objdata ; //  To return to an empty state.
115+             dassert (!other._holder );
116+         }
117+ 
118+         //  The explicit move constructor above will inhibit generation of the copy ctor, so
119+         //  explicitly request the default implementation.
120+ 
121+         /* * Copy construct a BSONObj. */ 
122+         BSONObj (const  BSONObj&) = default;
123+ #endif 
124+ 
109125        /* * Provide assignment semantics. We use the value taking form so that we can use copy
110126         *  and swap, and consume both lvalue and rvalue references. 
111127         */  
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments