Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 friend function not found
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Sep 29 2008 :  12:09:17 PM  Show Profile  Reply with Quote
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!

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Sep 29 2008 :  3:15:48 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=476
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000