How can I make the map::find operation case insensitive?

前端 未结 11 1895
野的像风
野的像风 2020-12-01 00:23

Does the map::find method support case insensitive search? I have a map as follows:

map > directory;
<         


        
11条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 00:32

    I use the following:

    bool str_iless(std::string const & a, 
                   std::string const & b)
    {
        return boost::algorithm::lexicographical_compare(a, b,  
                                                         boost::is_iless());
    }
    std::map 
             > case_insensitive_map(&str_iless);
    

提交回复
热议问题