Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 friend function not found

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
znakeeye Posted - Sep 29 2008 : 12:09:17 PM
This has been bugging me since v1.0 or so :P

1) Create a new MFC project "SingletonProblem" (dialog-based).
2) Add these lines in SingletonProblem.h:
class CSingleton
{
};

And a public function in CSingletonApp:
friend CSingleton& GetSingleton();

Then, in SingletonProblem.cpp, add the implementation:
CSingleton& GetSingleton()
{
    static CSingleton singleton;
    return singleton;
}


3) Go to CSingletonProblemDlg::OnInitDialog() and add:
GetSingleton();


VAX 1649 (and no previous version?) will not recognize that function call! It gets underlined and adding a "." makes the programmer go nuts... :)

This type of "elegant" singleton declarations are very common in our projects. Please fix this!
1   L A T E S T    R E P L I E S    (Newest First)
accord Posted - Sep 29 2008 : 3:15:48 PM
I am seeing the same effect here. Thank you for the clear description.

case=476

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000