Visual Studio Version 16.10.3, C++17, Win10-64.
I can't figure this one out. I think I've got all the buzzwords correct but I get errors for the following code:
#include <string>
using namespace std;
    
class AssetID {
private:
    string&           asset_Name;
public:
    const string& getName()  { return  asset_Name; }
}; // class AssetID
    
static
bool compareName(const AssetID* lhs, const AssetID* rhs) {
    return lhs->getName() < rhs->getName();
}; 
Code    Description Project File    Line    Suppression State
C2662   'const std::string &AssetID::getName(void)': cannot convert 'this' pointer from 'const AssetID' to 'AssetID &'  HOAAnalysis DTest.h 15  
C2662   'const std::string &AssetID::getName(void)': cannot convert 'this' pointer from 'const AssetID' to 'AssetID &'  HOAAnalysis Test.h  15  
 
     
    