I get_A(I i = I{ "A" }) { return i; }
```
#include <string>
#include <iostream>
struct I { std::string s; };
I get_A(I i = I{ "A" }) { return i; }
I get_B(I i = I{ "B" }) { return i; }
int main()
{
I a = get_A(),
b = get_B();
std::cout << a.s << " " << b.s << std::endl;
}
```
///-------------------------------------------------------------------------...
Result: A A
1 条评论