@@ -3367,7 +3367,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
33673367 const std::string rhs (eq==std::string::npos ? std::string (" 1" ) : macrostr.substr (eq+1 ));
33683368 try {
33693369 const Macro macro (lhs, rhs, dummy);
3370- macros.insert (std::pair<TokenString,Macro>( macro.name (), macro) );
3370+ macros.emplace ( macro.name (), macro);
33713371 } catch (const std::runtime_error& e) {
33723372 if (outputList) {
33733373 simplecpp::Output err{
@@ -3384,22 +3384,22 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
33843384
33853385 const bool strictAnsiUndefined = dui.undefined .find (" __STRICT_ANSI__" ) != dui.undefined .cend ();
33863386 if (!isGnu (dui) && !strictAnsiDefined && !strictAnsiUndefined)
3387- macros.insert (std::pair<TokenString, Macro>( " __STRICT_ANSI__" , Macro (" __STRICT_ANSI__" , " 1" , dummy) ));
3387+ macros.emplace ( " __STRICT_ANSI__" , Macro (" __STRICT_ANSI__" , " 1" , dummy));
33883388
3389- macros.insert ( std::make_pair ( " __FILE__" , Macro (" __FILE__" , " __FILE__" , dummy) ));
3390- macros.insert ( std::make_pair ( " __LINE__" , Macro (" __LINE__" , " __LINE__" , dummy) ));
3391- macros.insert ( std::make_pair ( " __COUNTER__" , Macro (" __COUNTER__" , " __COUNTER__" , dummy) ));
3389+ macros.emplace ( " __FILE__" , Macro (" __FILE__" , " __FILE__" , dummy));
3390+ macros.emplace ( " __LINE__" , Macro (" __LINE__" , " __LINE__" , dummy));
3391+ macros.emplace ( " __COUNTER__" , Macro (" __COUNTER__" , " __COUNTER__" , dummy));
33923392 struct tm ltime {};
33933393 getLocaltime (ltime);
3394- macros.insert ( std::make_pair ( " __DATE__" , Macro (" __DATE__" , getDateDefine (<ime), dummy) ));
3395- macros.insert ( std::make_pair ( " __TIME__" , Macro (" __TIME__" , getTimeDefine (<ime), dummy) ));
3394+ macros.emplace ( " __DATE__" , Macro (" __DATE__" , getDateDefine (<ime), dummy));
3395+ macros.emplace ( " __TIME__" , Macro (" __TIME__" , getTimeDefine (<ime), dummy));
33963396
33973397 if (!dui.std .empty ()) {
33983398 const cstd_t c_std = simplecpp::getCStd (dui.std );
33993399 if (c_std != CUnknown) {
34003400 const std::string std_def = simplecpp::getCStdString (c_std);
34013401 if (!std_def.empty ())
3402- macros.insert ( std::make_pair ( " __STDC_VERSION__" , Macro (" __STDC_VERSION__" , std_def, dummy) ));
3402+ macros.emplace ( " __STDC_VERSION__" , Macro (" __STDC_VERSION__" , std_def, dummy));
34033403 } else {
34043404 const cppstd_t cpp_std = simplecpp::getCppStd (dui.std );
34053405 if (cpp_std == CPPUnknown) {
@@ -3416,7 +3416,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
34163416 }
34173417 const std::string std_def = simplecpp::getCppStdString (cpp_std);
34183418 if (!std_def.empty ())
3419- macros.insert ( std::make_pair ( " __cplusplus" , Macro (" __cplusplus" , std_def, dummy) ));
3419+ macros.emplace ( " __cplusplus" , Macro (" __cplusplus" , std_def, dummy));
34203420 }
34213421 }
34223422
@@ -3503,7 +3503,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
35033503 if (dui.undefined .find (macro.name ()) == dui.undefined .end ()) {
35043504 const MacroMap::iterator it = macros.find (macro.name ());
35053505 if (it == macros.end ())
3506- macros.insert (std::pair<TokenString, Macro>( macro.name (), macro) );
3506+ macros.emplace ( macro.name (), macro);
35073507 else
35083508 it->second = macro;
35093509 }
0 commit comments