class A
{
public:
A(const int n_);
A(const A& that_);
A& operator=(const A& that_);
};
A::A(const int n_)
{ cout << "A::A(int), n_=" << n_ << endl; }
A::A(const A& that_) // This is line 21
{ cout << "A::A(const A&)" << endl; }
A& A::operator=(const A& that_)
{ cout << "A::operator=(const A&)" << endl; }
int foo(const A& a_)
{ return 20; }
int main()
{
A a(foo(A(10))); // This is line 38
return 0;
}
Run Code Online (Sandbox Code Playgroud)
执行此代码给出了o/p:
A :: …
我的代码将大量文本数据传递给遗留的lib,后者负责存储它.但是,它往往会删除尾随空格.当我读回数据时,这是一个问题.由于我无法更改遗留代码,因此我考虑用一些不常见的ASCII字符替换所有空格.当我回读文本时,我可以将它们替换回来.
数据中只有空格 - 没有制表符或换行符.数据是字母数字,带有特殊字符.