Why can I not pass this comparison function as a template argument?
问题 I am trying to create an std::set with a function I defined for sorting, but I get the error: "Error: function "GFX::MeshCompare" is not a type name" Mesh.h namespace GFX { struct Mesh { [...] }; inline bool MeshCompare(const Mesh& a, const Mesh& b) { return ( (a.pTech < b.pTech) || ( (b.pTech == a.pTech) && (a.pMaterial < b.pMaterial) ) || ( (b.pTech == a.pTech) && (a.pMaterial == b.pMaterial) && (a.topology < b.topology) ) ); } }; Renderer.h namespace GFX { class Renderer { private: [...]