29 const std::string::size_type pos = 0 ) {
31 if ( pos >= decay.size() ) {
return decay; }
33 auto _p = std::string::npos;
34 Decays::CC::MapCC::const_iterator _i = map_.end();
36 for (
auto ic = map_.begin(); map_.end() != ic; ++ic ) {
38 std::string::size_type p = decay.find( ic->first, pos );
40 if ( std::string::npos == p ) {
continue; }
48 if ( std::string::npos == _p || map_.end() == _i ) {
return decay; }
51 std::string aux = decay;
52 aux.replace( _p, _i->first.size(), _i->second );
55 _p += _i->second.size();
57 return _p < aux.size() ? cc_( aux, map_, _p ) : aux;
69 std::string
Decays::CC::cc(
const std::string& decay,
const std::map<std::string, std::string>& map_ ) {
70 return cc_( decay, { map_.begin(), map_.end() } );