lundi 27 juillet 2020

muti index container match by string

i wanna use string as a key for muti index, but i find that examples always show the demo with std::string, if I want to use const char*, what should I do to make it nocase-matched?

typedef struct  {
    std::string name;
}student;
 
struct by_name{};
 
using namespace boost::multi_index;
 
typedef
boost::multi_index_container<
        student,
        indexed_by<
                ordered_unique<tag< by_name >, member<student, std::string, &student::name>>,
                
        >
> StuContainer;

Aucun commentaire:

Enregistrer un commentaire