Passing non-const references to rvalues in C++

前端 未结 7 1010
长发绾君心
长发绾君心 2020-12-09 18:28

In the following line of code:

bootrec_reset(File(path, size, off), blksize);

Calling a function with prototype:

static void b         


        
7条回答
  •  醉话见心
    2020-12-09 18:57

    Alternatively, simply overload.

    static void bootrec_reset(File &&file, ssize_t blksize) {
        return bootrec_reset(file, blksize);
    }
    

    This is the easiest solution.

提交回复
热议问题