This works (displays 3) in Visual Studio 2008:
Code:
class A
{
private:
A(){}
public:
int foo(){return 3;}
friend A* whatever();
};
A* whatever()
{
return new A;
}
int _tmain(int argc, _TCHAR* argv[])
{
A* baz=whatever();
printf("%d\n",baz->foo());
return 0;
}
I would expect C# to be identical to the above apart from maybe the odd bit of syntax.
With a private constructor you have to have either a member function that returns a new object such as the create() function previously or a friend that will create one for you.