std::make_tuple doesn't make references

后端 未结 6 820
名媛妹妹
名媛妹妹 2020-12-04 23:53

I\'ve been experimenting with std::tuple in combination with references:

#include 
#include 

int main() {
  int a,         


        
6条回答
  •  渐次进展
    2020-12-05 00:40

    What about std::make_tuple(a, b);

    Admittedly, it kind of defeats the purpose, but for functions like make_shared you still get benefits.

    Warning, I haven't tried to compile this, but I believe it will work.

提交回复
热议问题