Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Create Implementation fails when using lambdas

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
khb Posted - Oct 29 2016 : 1:05:58 PM
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
1   L A T E S T    R E P L I E S    (Newest First)
ChrisG Posted - Oct 30 2016 : 05:31:17 AM
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.

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