Why would a copy constructor have more than one parameter?

后端 未结 4 953
闹比i
闹比i 2021-02-05 17:01

$12.8/2 - \'A non-template constructor for class X is a copy constructor if its first parameter is of type X&, const X&, volatile X& or const

4条回答
  •  终归单人心
    2021-02-05 17:17

    The old std::basic_string does have one too:

    basic_string(const basic_string& s, 
             size_type pos = 0, size_type n = npos)
    

提交回复
热议问题