ITADN

I get_A(I i = I{ "A" }) { return i; }

#289OpenBDOTimer 创建于 2026-02-08
B
BDOTimercommented
``` #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 条评论