Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If all you're doing is accessing public members, sure.


`private` is only private to the module, not the struct/class, (In other words, all functions in the same module are all C++ style `friend`s) and so free function in same module work.


It works for all functions that have parameters, `f(a)` and `a.f()` are equivalent.


Yes, but I presume that f() cannot access private members of a.


That's correct.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: