예제 #1
0
 void check_dupes(const Ptree &pt)
 {
     if(pt.size() <= 1)
         return;
     const typename Ptree::key_type *lastkey = 0;
     typename Ptree::const_assoc_iterator it = pt.ordered_begin(),
                                          end = pt.not_found();
     lastkey = &it->first;
     for(++it; it != end; ++it) {
         if(*lastkey == it->first)
             BOOST_PROPERTY_TREE_THROW(ini_parser_error(
                 "duplicate key", "", 0));
         lastkey = &it->first;
     }
 }