Is there a difference between universal references and forwarding references?

前端 未结 2 797
你的背包
你的背包 2020-11-28 09:28

An argument to this function will bind to an rvalue reference:

void f(int && i);

However, an argument to this function will bind

2条回答
  •  Happy的楠姐
    2020-11-28 10:12

    Unfortunately, it's confusing, but they are nothing more than two names for the same thing.
    Universal reference was proposed (I guess) by Meyers far ago (see here as an example).
    Forwarding reference is picked up directly from the standardese. That's all.

提交回复
热议问题