lundi 28 décembre 2015

How can be used returned temporary link in best way?

  • for example I have

    class A {
         AHelper&& getAHelper(){
             return AHelper();
        }
    }
    
    int otherfunc(){
        A a;
        xfunc( a.getAHelper() );
    }
    
    

    May I use it only if I want to pass it to another function? What are benefits?

Aucun commentaire:

Enregistrer un commentaire