public friend swap member function

In the beautiful answer to the copy-and-swap-idiom there is a piece of code I need a bit of help: class dumb_array { public: // … friend void swap(dumb_array& first, dumb_array& second) // nothrow { using std::swap; swap(first.mSize, second.mSize); swap(first.mArray, second.mArray); } // … }; and he adds a note There are other claims that we … Read more

Why does C# not provide the C++ style ‘friend’ keyword? [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago. Improve this question The C++ friend keyword allows a class A to designate class B as its friend. This … Read more