[gtkmm] C++11: Use emplace_back() instead of push_back().



commit f4aecf18f8561bc377d596c3ce5898d91247cc5e
Author: Murray Cumming <murrayc murrayc com>
Date:   Fri Feb 5 23:25:35 2016 +0100

    C++11: Use emplace_back() instead of push_back().

 gtk/src/gesture.ccg      |    2 +-
 gtk/src/recentfilter.ccg |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/src/gesture.ccg b/gtk/src/gesture.ccg
index 3c7e8a6..77dee30 100644
--- a/gtk/src/gesture.ccg
+++ b/gtk/src/gesture.ccg
@@ -26,7 +26,7 @@ std::vector<const GdkEventSequence*> Gesture::get_sequences() const
   auto list = g_list_first(gtk_gesture_get_sequences(const_cast<GtkGesture*>(gobj())));
 
   for (GList* node = list; node; node = g_list_next(node))
-    sequences.push_back(static_cast<GdkEventSequence*>(node->data));
+    sequences.emplace_back(static_cast<GdkEventSequence*>(node->data));
 
   g_list_free(list);
 
diff --git a/gtk/src/recentfilter.ccg b/gtk/src/recentfilter.ccg
index cc4cf98..61acfe7 100644
--- a/gtk/src/recentfilter.ccg
+++ b/gtk/src/recentfilter.ccg
@@ -38,11 +38,11 @@ static gboolean SignalProxy_Custom_gtk_callback(const GtkRecentFilterInfo* filte
 
     for(int i = 0; filter_info->groups[i] != nullptr; ++i)
     {
-      cppInfo.groups.push_back( Glib::convert_const_gchar_ptr_to_ustring(filter_info->groups[i]) );
+      cppInfo.groups.emplace_back( Glib::convert_const_gchar_ptr_to_ustring(filter_info->groups[i]) );
     }
     for(int i = 0; filter_info->applications[i] != nullptr; ++i)
     {
-      cppInfo.applications.push_back( Glib::convert_const_gchar_ptr_to_ustring(filter_info->applications[i]) 
);
+      cppInfo.applications.emplace_back( 
Glib::convert_const_gchar_ptr_to_ustring(filter_info->applications[i]) );
     }
 
     cppInfo.age = filter_info->age;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]