Passing/Moving parameters of a constructor in C++0x

后端 未结 3 643

If I have a constructor with n parameters such that any argument to that can be an rvalue and lvalue. Is it possible to do support this with move semantics for the rvalues witho

3条回答
  •  深忆病人
    2021-02-03 23:10

    Depending on what c++ compiler you are using, you could look into "functions with variable argument lists"

    The idea is that you can pass in as many parameters as you want to the method and it just populates into an array that you can loop through.

    For microsoft c++, the following blogposts might be helpful:

    http://msdn.microsoft.com/en-us/library/fxhdxye9(v=VS.100).aspx http://blogs.msdn.com/b/slippman/archive/2004/02/16/73932.aspx

提交回复
热议问题