There is a freestanding function (non-member one) defined as:
template<class T, std::size_t N>
auto foo(T const(&init)[N]) { /* ... */ }
foo() is intended to deduce the N (array size)
Additionally, within the same namespace there is a class defined as:
class Bar {
friend auto foo( Bar const(&)[/* ??? */] ); /* <-------- The goal to make it right */
private:
Bar( void ) { /* ... */ }
};
My problem is I am not successful yet to declare the foo() as friend to Bar class so that it can access the private members.
In the foo() declaration, there is std::size_t N template parameter. But how to make the friendship of all N values?
Many thanks in advance for anyone willing to help.
Martin