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