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
 Create Implementation fails when using lambdas
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

khb
Tomato Guru

Germany
337 Posts

Posted - Oct 29 2016 :  1:05:58 PM  Show Profile  Reply with Quote
I implemented a class with a few member functions. I then declared the following member function in the class in the header file:
CString strMap(CString strExtension);
Then I chose "Create Implementation" on the declaration from the context menu. The result was, that the implementation of the following member function (which is located in the cpp file):
void CExtensionMap::vFill(CStringArray &saExtensions)
{
    saExtensions.RemoveAll();
    for(const auto& tExtensions : m_tExtVec)
        saExtensions.Add(std::accumulate(std::next(tExtensions.begin()),  // A
                                         tExtensions.end(),               // B
                                         tExtensions[0],                  // C
                                         [](const CString& a, const CString& b) { return a + _TCHAR(';') + b; }));
}
was turned into the following mess:
void CExtensionMap::vFill(CStringArray &saExtensions)
{
    saExtensions.RemoveAll();
    for(const auto& tExtensions : m_tExtVec)
        saExtensions.Add(std::accumulate(std::next(tExtensions.begin()),  // A
                                         tExtensions.end(),               // B
                                         tExtensions[0],                  // C

                                         CString CExtensionMap::strMap(CString strExtension)
    {

    }

    [](const CString& a, const CString& b) { return a + _TCHAR(';') + b; }));
}
I declared strMap() directly after vFill(), so I expected that VA puts the implementation of strMap() behind vFill() and not inside vFill().

I just noticed that "Create Implementation" does not fail for me if I remove the comments A, B, and C.

I'm using Windows 7, VS2012, Build 2114

Edited by - khb on Oct 29 2016 3:45:37 PM

ChrisG
Whole Tomato Software

USA
299 Posts

Posted - Oct 30 2016 :  05:31:17 AM  Show Profile  Reply with Quote
Hello khb,

This issue is caused by the same root problem as bug report case 86888, so I have added your reproduction to the report.

Thank you for the clear description of the issue.
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