I have the following problem using the extract method refactoring with the 'extract to source' option checked:
if there is no newline after the last closing bracket in the C++ cpp file, the function declaration will be inserted INSIDE the last function of that cpp. To clarify things I attach an example showing the file before and after the refactoring. This happens not with all cpp files, but with most (those that use namespaces in .hpp, not sure yet). The resulting source code is not compilable.
Before refactoring: [....] BOOL CBild::IstFehlerortSuchergebnis(const CString& strFehlerortDBID) const { return m_pMapFESGefunden->Lookup(strFehlerortDBID, strValue); }<End of file here>