Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
its just it....!!!

reply with a one or more examples.....simple though
Posted

It is possible but makes no sense, because a friend function is external but must call class code.

The interface would be like:
C++
MyClass* friendConstructor();


You should learn to write "clean code" and avoid so tricky stuff. You better use your time and learn the basics. Life is too short to waiste it. ;-)
 
Share this answer
 
Not as a plain constructor.
If the Named Constructor Idiom in C++[^] makes any sense is up to you.
Regards
Andi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900