diff options
author | Murray Cumming <murrayc@murrayc.com> | 2016-02-05 23:28:12 +0100 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2016-02-05 23:39:39 +0100 |
commit | 1c212efc8e0983a69b29a5cbef7565b13e4ebfa3 (patch) | |
tree | 0fa97d18f9a0255c8c6aa07aee4b3173c8d9ab3a /glib/glibmm | |
parent | 757fab512e4f390fa6e8645202efd87eebb42b66 (diff) | |
download | glibmm-1c212efc8e0983a69b29a5cbef7565b13e4ebfa3.tar.gz |
C++11: Use emplace_back() instead of push_back().
Diffstat (limited to 'glib/glibmm')
-rw-r--r-- | glib/glibmm/class.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/containerhandle_shared.h | 2 | ||||
-rw-r--r-- | glib/glibmm/dispatcher.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/interface.cc | 4 | ||||
-rw-r--r-- | glib/glibmm/property.cc | 6 | ||||
-rw-r--r-- | glib/glibmm/threadpool.cc | 2 | ||||
-rw-r--r-- | glib/glibmm/wrap.cc | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/glib/glibmm/class.cc b/glib/glibmm/class.cc index bf57f84e..bbaf37fa 100644 --- a/glib/glibmm/class.cc +++ b/glib/glibmm/class.cc @@ -218,7 +218,7 @@ void Class::custom_class_init_function(void* g_class, void* class_data) GValue* g_value = g_new0(GValue, 1); g_value_init(g_value, iface_props[p]->value_type); g_param_value_set_default(iface_props[p], g_value); - props->push_back(g_value); + props->emplace_back(g_value); g_object_class_override_property(gobject_class, props->size(), prop_name); } diff --git a/glib/glibmm/containerhandle_shared.h b/glib/glibmm/containerhandle_shared.h index d88182da..4d5a552c 100644 --- a/glib/glibmm/containerhandle_shared.h +++ b/glib/glibmm/containerhandle_shared.h @@ -378,7 +378,7 @@ template <class Cont, class In> void fill_container(Cont& container, In pbegin, In pend) { for(; pbegin != pend; ++pbegin) - container.push_back(*pbegin); + container.emplace_back(*pbegin); } #endif /* GLIBMM_HAVE_TEMPLATE_SEQUENCE_CTORS */ diff --git a/glib/glibmm/dispatcher.cc b/glib/glibmm/dispatcher.cc index 1bbab0ec..f0ea19de 100644 --- a/glib/glibmm/dispatcher.cc +++ b/glib/glibmm/dispatcher.cc @@ -330,7 +330,7 @@ void DispatchNotifier::send_notification(Dispatcher* dispatcher) const std::lock_guard<std::mutex> lock (mutex_); const bool was_empty = notify_queue_.empty(); - notify_queue_.push_back(DispatchNotifyData(dispatcher, this)); + notify_queue_.emplace_back(DispatchNotifyData(dispatcher, this)); if(was_empty) { diff --git a/glib/glibmm/interface.cc b/glib/glibmm/interface.cc index be04a50d..f592d1b0 100644 --- a/glib/glibmm/interface.cc +++ b/glib/glibmm/interface.cc @@ -81,7 +81,7 @@ Interface::Interface(const Interface_Class& interface_class) GValue* g_value = g_new0(GValue, 1); g_value_init(g_value, iface_props[p]->value_type); g_param_value_set_default(iface_props[p], g_value); - props->push_back(g_value); + props->emplace_back(g_value); const gchar* prop_name = g_param_spec_get_name(iface_props[p]); GParamSpec* new_spec = g_param_spec_override(prop_name, iface_props[p]); @@ -99,7 +99,7 @@ Interface::Interface(const Interface_Class& interface_class) // The GObject is not instantiated yet. Add to the custom_interface_classes // and add the interface in the Glib::Object constructor. std::lock_guard<std::mutex> lock(extra_object_base_data_mutex); - extra_object_base_data[this].custom_interface_classes.push_back(&interface_class); + extra_object_base_data[this].custom_interface_classes.emplace_back(&interface_class); } } } diff --git a/glib/glibmm/property.cc b/glib/glibmm/property.cc index 0971e14d..302d48a0 100644 --- a/glib/glibmm/property.cc +++ b/glib/glibmm/property.cc @@ -186,7 +186,7 @@ void custom_set_property_callback(GObject* object, unsigned int property_id, GValue* g_value = g_new0(GValue, 1); g_value_init(g_value, G_VALUE_TYPE((*iface_props)[p])); g_value_copy((*iface_props)[p], g_value); - obj_iface_props->push_back(g_value); + obj_iface_props->emplace_back(g_value); } } @@ -245,7 +245,7 @@ bool PropertyBase::lookup_property(const Glib::ustring& name) g_assert(G_PARAM_SPEC_VALUE_TYPE(param_spec_) == G_VALUE_TYPE(value_.gobj())); g_param_spec_ref(param_spec_); - get_obj_custom_props(object_->gobj())->push_back(this); + get_obj_custom_props(object_->gobj())->emplace_back(this); } return (param_spec_ != nullptr); @@ -271,7 +271,7 @@ void PropertyBase::install_property(GParamSpec* param_spec) auto obj_custom_props = get_obj_custom_props(object_->gobj()); const unsigned int pos_in_obj_custom_props = obj_custom_props->size(); - obj_custom_props->push_back(this); + obj_custom_props->emplace_back(this); // We need to offset by 1 as zero is an invalid property id. const unsigned int property_id = pos_in_obj_custom_props + iface_props_size + 1; diff --git a/glib/glibmm/threadpool.cc b/glib/glibmm/threadpool.cc index f0218154..163fb19d 100644 --- a/glib/glibmm/threadpool.cc +++ b/glib/glibmm/threadpool.cc @@ -58,7 +58,7 @@ sigc::slot<void>* ThreadPool::SlotList::push(const sigc::slot<void>& slot) { Threads::Mutex::Lock lock (mutex_); - list_.push_back(slot); + list_.emplace_back(slot); return &list_.back(); } diff --git a/glib/glibmm/wrap.cc b/glib/glibmm/wrap.cc index eebe888c..18725a99 100644 --- a/glib/glibmm/wrap.cc +++ b/glib/glibmm/wrap.cc @@ -86,7 +86,7 @@ void wrap_register(GType type, WrapNewFunction func) return; const guint idx = wrap_func_table->size(); - wrap_func_table->push_back(func); + wrap_func_table->emplace_back(func); // Store the table index in the type's static data. g_type_set_qdata(type, Glib::quark_, GUINT_TO_POINTER(idx)); |