zoukankan      html  css  js  c++  java
  • c++11 右值引用

    #include <bits/stdc++.h>
    using namespace std;
    string Get(){
    	return string(200000000,'a');
    }
    int main(){
    	int t=clock();
    	const string &s0=Get();
    	cerr<<clock()-t<<endl;
    	t=clock();
    	string s=Get();
    	cerr<<clock()-t<<endl;
    	t=clock();
    	string &&ss=Get();
    	cerr<<clock()-t<<endl;
    	t=clock();
    	string sss=move(s);
    	//move: jiang you zuo zhi bian cheng you zhi bu fu zhi
    	cerr<<clock()-t<<endl;
    	t=clock();
    	string &&ssss=move(ss);
    	//move: jiang you zuo zhi bian cheng you zhi bu fu zhi
    	cerr<<clock()-t<<endl;
    }
    
  • 相关阅读:
    POJ
    POJ
    BZOJ
    HDU
    codeforces
    BZOJ
    SPOJ
    SPOJ
    SPOJ
    HDU
  • 原文地址:https://www.cnblogs.com/Yuhuger/p/10610729.html
Copyright © 2011-2022 走看看