From kjell.ahlstedt@bredband.net Tue Oct 13 08:18:20 2015 Return-Path: X-Original-To: libsigc-list@gnome.org Delivered-To: libsigc-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id 0955E7626F for ; Tue, 13 Oct 2015 08:18:20 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -1.9 X-Spam-Level: X-Spam-Status: No, score=-1.9 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XOqVvdpqOhCq for ; Tue, 13 Oct 2015 08:18:18 +0000 (UTC) Received: from smtprelay-h22.telenor.se (smtprelay-h22.telenor.se [195.54.99.197]) by restaurant.gnome.org (Postfix) with ESMTP id A20A876262 for ; Tue, 13 Oct 2015 08:18:17 +0000 (UTC) Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-h22.telenor.se (Postfix) with ESMTP id 60048F40D for ; Tue, 13 Oct 2015 10:18:15 +0200 (CEST) X-SMTPAUTH-B2: [kjell.ahlstedt@bredband.net] X-SENDER-IP: [85.229.144.197] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2ACBADkvBxWPMWQ5VUNUCABAYNYbocitVaCfxIPgnKCCoJ5EQEBAQEBAQEGAQEBAUGEXIEIHwEdFhgDAgECATEnCAEBiC8Iq3uUdQSGdYophBcFlhZ6hB+JWZZBg283hDBvAYZwAQEB X-IPAS-Result: A2ACBADkvBxWPMWQ5VUNUCABAYNYbocitVaCfxIPgnKCCoJ5EQEBAQEBAQEGAQEBAUGEXIEIHwEdFhgDAgECATEnCAEBiC8Iq3uUdQSGdYophBcFlhZ6hB+JWZZBg283hDBvAYZwAQEB X-IronPort-AV: E=Sophos;i="5.17,677,1437429600"; d="scan'208,217";a="981412639" Received: from c-c590e555.06-203-73746f44.cust.bredbandsbolaget.se (HELO [192.168.1.64]) ([85.229.144.197]) by ipb3.telenor.se with ESMTP; 13 Oct 2015 10:11:49 +0200 From: Kjell Ahlstedt To: libsigc-list@gnome.org Message-ID: <561CBCC4.6020709@bredband.net> Date: Tue, 13 Oct 2015 10:11:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------060609000701090308060701" Subject: [sigc] Move operators in libsigc++ X-BeenThere: libsigc-list@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Mailing list for libsigc++ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Oct 2015 08:18:20 -0000 This is a multi-part message in MIME format. --------------060609000701090308060701 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit I have filed bug https://bugzilla.gnome.org/show_bug.cgi?id=756484 that discusses the move constructors and move assignment operators in libsigc++. Now is your chance to comment on it, before I fix it. We also need more methods that take an rvalue reference parameter, if we shall really benefit from the move constructors and move assignments. sigc::signal#<>::connect(slot_type&& slot_); Glib::SignalProxy#<>::connect(SlotType&& slot, bool after = true); Kjell Ahlstedt --------------060609000701090308060701 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit I have filed bug https://bugzilla.gnome.org/show_bug.cgi?id=756484 that discusses the move constructors and move assignment operators in libsigc++. Now is your chance to comment on it, before I fix it.

We also need more methods that take an rvalue reference parameter, if we shall really benefit from the move constructors and move assignments.
    sigc::signal#<>::connect(slot_type&& slot_);
    Glib::SignalProxy#<>::connect(SlotType&& slot, bool after = true);

Kjell Ahlstedt

--------------060609000701090308060701-- From andrejs.hanins@ubnt.com Fri Oct 23 12:01:28 2015 Return-Path: X-Original-To: libsigc-list@gnome.org Delivered-To: libsigc-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id 5B97976A4B for ; Fri, 23 Oct 2015 12:01:28 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -2.701 X-Spam-Level: X-Spam-Status: No, score=-2.701 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kDjnVyxDbUyd for ; Fri, 23 Oct 2015 12:01:27 +0000 (UTC) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) by restaurant.gnome.org (Postfix) with ESMTP id 5974E76234 for ; Fri, 23 Oct 2015 12:01:26 +0000 (UTC) Received: by lffz202 with SMTP id z202so80929707lff.3 for ; Fri, 23 Oct 2015 05:01:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ubnt.com; s=google; h=to:from:subject:message-id:date:user-agent:mime-version :content-type:content-transfer-encoding; bh=khwRgGoaj15TS/Oycx1/Skdm4gBy26/Q/lyZ8CYQkqA=; b=jdcgvzusJFIEUoQBAaqmJt5WSusyLVQBsuEZGhhrbSRbLBHnT70Dz1912tcPgL9O32 iNBcXBqvXdLR1rJT0ul6Ln0ZL0rncfSLjybmH23MEiIqprXlZzWGOeIyXd+exw6QPjN8 3E+gAqK5YYip4saKkEJUkRxMpNWNZdWVPeTCU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=khwRgGoaj15TS/Oycx1/Skdm4gBy26/Q/lyZ8CYQkqA=; b=AXzwJAymuyPPFFuHd2ZurXWuYhHbAX80TOy4Lp+Ib9t1TIPoieAEfYYORTMcpOcG2m syGXrlS252FyK5niu0HKjttRjZPv6Q2HzkP+s552/CcvINJkhemX67zdZ83ep8g5Wce4 QkHpUmRdvPD+eNaEYeruk3lQDN2P+NHqfEUMZyELo6VbhGGqWTfSgxltk3Qb6mL6gSN+ uzhjYLKYfEkOo2HSDBqdAjoZyCoCdrg+Jr1IC2HBAbrkPZ/EuBsM4JJPRH7VpPZlA0Zc dbXKdTRWskCdTUq6kTrhTlzoNnSx73sG7aFhqDTLI+VWFMDfcWQOIi73Vu1qWmpiuXqr nYUg== X-Gm-Message-State: ALoCoQlG3D9iuOgTIekaSyAY7fTGlmxV6ZIs5t0tfvQa8/p/j0F76iI/gxKBxhva56XDGmTCSQSG+Tlj4z1n3Kb+GFRz4243MHvmk9tDbIB47swDg++HWZL3dlrdvW6uUgl+erY0oJnmeNmgqvIdQpc9bx1jZueivKKWRBJet1HcD3iSIZpN8rIAqa9klGO/tulrscbgV/1O X-Received: by 10.25.18.39 with SMTP id h39mr7275577lfi.7.1445601687158; Fri, 23 Oct 2015 05:01:27 -0700 (PDT) Received: from [192.168.5.208] ([80.233.186.214]) by smtp.googlemail.com with ESMTPSA id zz9sm3187229lbb.32.2015.10.23.05.01.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 05:01:26 -0700 (PDT) To: libsigc-list@gnome.org From: Andrejs Hanins Message-ID: <562A2195.9030203@ubnt.com> Date: Fri, 23 Oct 2015 15:01:25 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: [sigc] Move constructor for slots not selected X-BeenThere: libsigc-list@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Mailing list for libsigc++ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2015 12:01:28 -0000 Hi, I noticed that both in 2.6.1 and current trunk (cabc88f) the move constructor for the slot is not selected by the compiler (gcc 4.9 and 4.8.4 tried) even in the most trivial case. Take test_slot_move.cc unit test for example: sigc::slot s2(std::move(s1)); If you now do (bool)s1 it will evaluate to 'true'. Also s1() works and calls foo() as if s1 wasn't moved to s2. I tried to add traces to slot1 copy and move constructors and indeed only copy constructor is called, but not move. So, something is wrong here - either compiler bug (unlikely) or some code in the slot/slot_base/functor_base prevents compiler from selecting move semantics for constructor. BR, Andrey From kjell.ahlstedt@bredband.net Fri Oct 23 17:49:06 2015 Return-Path: X-Original-To: libsigc-list@gnome.org Delivered-To: libsigc-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id C02F0763ED for ; Fri, 23 Oct 2015 17:49:06 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -2.6 X-Spam-Level: X-Spam-Status: No, score=-2.6 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8dCSffx9zda3 for ; Fri, 23 Oct 2015 17:49:04 +0000 (UTC) Received: from smtprelay-h31.telenor.se (smtprelay-h31.telenor.se [213.150.131.4]) by restaurant.gnome.org (Postfix) with ESMTP id 775F676234 for ; Fri, 23 Oct 2015 17:49:03 +0000 (UTC) Received: from ipb3.telenor.se (ipb3.telenor.se [195.54.127.166]) by smtprelay-h31.telenor.se (Postfix) with ESMTP id 54134C766 for ; Fri, 23 Oct 2015 19:48:46 +0200 (CEST) X-SMTPAUTH-B2: [kjell.ahlstedt@bredband.net] X-SENDER-IP: [85.229.144.197] X-LISTENER: [smtp.bredband.net] X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2DJAQC1cSpWPMWQ5VUNURkBAwYIAQEBg1xvwBMhhXwCgXoQAQEBAQEBAQYBAQEBQYRyAQEBA3gBEAsEHRYPCQMCAQIBMRQGDQgBAYgxCLJNk08BAQEBAQEBAwEBAQEBAR2Gd4R+hQ0HhC4FliuFGaQrOII8HYFXcAGGQgEBAQ X-IPAS-Result: A2DJAQC1cSpWPMWQ5VUNURkBAwYIAQEBg1xvwBMhhXwCgXoQAQEBAQEBAQYBAQEBQYRyAQEBA3gBEAsEHRYPCQMCAQIBMRQGDQgBAYgxCLJNk08BAQEBAQEBAwEBAQEBAR2Gd4R+hQ0HhC4FliuFGaQrOII8HYFXcAGGQgEBAQ X-IronPort-AV: E=Sophos;i="5.20,187,1444687200"; d="scan'208,217";a="989037060" Received: from c-c590e555.06-203-73746f44.cust.bredbandsbolaget.se (HELO [192.168.1.64]) ([85.229.144.197]) by ipb3.telenor.se with ESMTP; 23 Oct 2015 19:48:45 +0200 To: Andrejs Hanins References: <562A2195.9030203@ubnt.com> From: Kjell Ahlstedt Message-ID: <562A72FD.4050207@bredband.net> Date: Fri, 23 Oct 2015 19:48:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562A2195.9030203@ubnt.com> Content-Type: multipart/alternative; boundary="------------040307030100000006010701" Cc: libsigc-list@gnome.org Subject: Re: [sigc] Move constructor for slots not selected X-BeenThere: libsigc-list@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Mailing list for libsigc++ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Oct 2015 17:49:06 -0000 This is a multi-part message in MIME format. --------------040307030100000006010701 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit There are move constructors and move assignment operators for sigc::slot_base and sigc::slot1<> .. sigc::slot7<>, but none for sigc::slot<>. See https://bugzilla.gnome.org/show_bug.cgi?id=756484. Adding them would mean adding API, which will have to wait until libsigc++ 2.7.x. Like I say in comment 4 in the bug report, I can create a libsigc-2-6 branch and push the patch to the master branch now, if you want it now, and is willing to use the latest code from the git repository. Kjell Den 2015-10-23 kl. 14:01, skrev Andrejs Hanins: > Hi, > > I noticed that both in 2.6.1 and current trunk (cabc88f) the move constructor for the slot is not selected by the compiler (gcc 4.9 and 4.8.4 tried) even in the most trivial case. Take test_slot_move.cc unit test for example: > > sigc::slot s2(std::move(s1)); > > If you now do (bool)s1 it will evaluate to 'true'. Also s1() works and calls foo() as if s1 wasn't moved to s2. I tried to add traces to slot1 copy and move constructors and indeed only copy constructor is called, but not move. So, something is wrong here - either compiler bug (unlikely) or some code in the slot/slot_base/functor_base prevents compiler from selecting move semantics for constructor. > > BR, Andrey > _______________________________________________ > --------------040307030100000006010701 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 7bit There are move constructors and move assignment operators for sigc::slot_base and sigc::slot1<> .. sigc::slot7<>, but none for sigc::slot<>. See https://bugzilla.gnome.org/show_bug.cgi?id=756484. Adding them would mean adding API, which will have to wait until libsigc++ 2.7.x. Like I say in comment 4 in the bug report, I can create a libsigc-2-6 branch and push the patch to the master branch now, if you want it now, and is willing to use the latest code from the git repository.

Kjell

Den 2015-10-23 kl. 14:01, skrev Andrejs Hanins:
Hi,

	I noticed that both in 2.6.1 and current trunk (cabc88f) the move constructor for the slot is not selected by the compiler (gcc 4.9 and 4.8.4 tried) even in the most trivial case. Take test_slot_move.cc unit test for example:

sigc::slot<void,int> s2(std::move(s1));

If you now do (bool)s1 it will evaluate to 'true'. Also s1() works and calls foo() as if s1 wasn't moved to s2. I tried to add traces to slot1 copy and move constructors and indeed only copy constructor is called, but not move. So, something is wrong here - either compiler bug (unlikely) or some code in the slot/slot_base/functor_base prevents compiler from selecting move semantics for constructor.

BR, Andrey
_______________________________________________


--------------040307030100000006010701-- From andrejs.hanins@ubnt.com Wed Oct 28 13:59:56 2015 Return-Path: X-Original-To: libsigc-list@gnome.org Delivered-To: libsigc-list@gnome.org Received: from localhost (localhost.localdomain [127.0.0.1]) by restaurant.gnome.org (Postfix) with ESMTP id BE0ED76A47 for ; Wed, 28 Oct 2015 13:59:56 +0000 (UTC) X-Virus-Scanned: by amavisd-new at gnome.org X-Spam-Flag: NO X-Spam-Score: -2.701 X-Spam-Level: X-Spam-Status: No, score=-2.701 tagged_above=-999 required=2 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham Received: from restaurant.gnome.org ([127.0.0.1]) by localhost (restaurant.gnome.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id idENDrWiFz9A for ; Wed, 28 Oct 2015 13:59:55 +0000 (UTC) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) by restaurant.gnome.org (Postfix) with ESMTP id B99B476A1E for ; Wed, 28 Oct 2015 13:59:55 +0000 (UTC) Received: by lfaz124 with SMTP id z124so4148923lfa.1 for ; Wed, 28 Oct 2015 06:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ubnt.com; s=google; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=ppecK5e04elT5F6DCiGFyTmeuRfJQRRvAQA0QWdNfVs=; b=R6/iAOBNzncuiSsYLWB9MsQS4PSFzmGl7uHxvkSouvcQFgS91BdJOWneQ2jOfEPDpz +hVJ3sTBtP4ISVSzt68Yq9ZBiGAH1Ko8BKFoCawSHxovmpYdclou80EllR/O4ZB2MLT3 w3gYcEllevRcjqISBKzMAWQFIJC67VguqRlxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ppecK5e04elT5F6DCiGFyTmeuRfJQRRvAQA0QWdNfVs=; b=KgdUmI1n4ArK7uX1s4LFJo/CPWADHs4zZn7o7lvM+kRoOVMa0x4Fd6rm6pReaLwJYx bWkqC42Cp1zg5OScqMhdxvrz0vhUOsBdvK5BOFnD3nOM16k51QeJglKw0dH0hjayfRbJ Nu0rqADZe/FVE7t7j7s3MhES+AH4CozB132/mVmtvhiRJSdKhkd3P+6zb8yd+XCYswPp lfBPF3R0tEm56powTNeHGsmw5LId2FgVNWuPMURDLD8GXdMuz0bk6/NKiZpzC588zv5d HuEWEfm08HfulBQME31a8d4iLUBcJHFeDslG9XumdhjwOnnYE/50nDQF+zqduq/qITIa h5bw== X-Gm-Message-State: ALoCoQm2Ais4xP7cQT2FYPpU0h6u3AQDxfqucYjILLTdDk0yTXtGjdtigufo6BmgjjR2Ivxm0VGlM4t5s33ve1EVexaeG4n50nxdv1QE9hMetvFLHlbV4tO8SurO3NTjisknjpTu0Kh+ps7vEzXfKBwLdE0u6z1SnTc6O6lWxj9U5Mhg1ouRzYMpUb3XAWVJMg52EBZhC+r2 X-Received: by 10.25.89.9 with SMTP id n9mr1790372lfb.9.1446040795743; Wed, 28 Oct 2015 06:59:55 -0700 (PDT) Received: from [192.168.5.209] ([80.233.186.214]) by smtp.googlemail.com with ESMTPSA id og10sm7841795lbb.26.2015.10.28.06.59.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Oct 2015 06:59:55 -0700 (PDT) To: Kjell Ahlstedt References: <562A2195.9030203@ubnt.com> <562A72FD.4050207@bredband.net> From: Andrejs Hanins Message-ID: <5630D4DA.1020009@ubnt.com> Date: Wed, 28 Oct 2015 15:59:54 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <562A72FD.4050207@bredband.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: libsigc-list@gnome.org Subject: Re: [sigc] Move constructor for slots not selected X-BeenThere: libsigc-list@gnome.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Mailing list for libsigc++ List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2015 13:59:56 -0000 Thank you Kjell, I have overlooked that slot<> itself is not movable. I don't need a branch for this, can live without movable slots for now. On 10/23/2015 08:48 PM, Kjell Ahlstedt wrote: > There are move constructors and move assignment operators for sigc::slot_base and sigc::slot1<> .. sigc::slot7<>, but none for sigc::slot<>. See https://bugzilla.gnome.org/show_bug.cgi?id=756484. Adding them would mean adding API, which will have to wait until libsigc++ 2.7.x. Like I say in comment 4 in the bug report, I can create a libsigc-2-6 branch and push the patch to the master branch now, if you want it now, and is willing to use the latest code from the git repository. > > Kjell > > Den 2015-10-23 kl. 14:01, skrev Andrejs Hanins: >> Hi, >> >> I noticed that both in 2.6.1 and current trunk (cabc88f) the move constructor for the slot is not selected by the compiler (gcc 4.9 and 4.8.4 tried) even in the most trivial case. Take test_slot_move.cc unit test for example: >> >> sigc::slot s2(std::move(s1)); >> >> If you now do (bool)s1 it will evaluate to 'true'. Also s1() works and calls foo() as if s1 wasn't moved to s2. I tried to add traces to slot1 copy and move constructors and indeed only copy constructor is called, but not move. So, something is wrong here - either compiler bug (unlikely) or some code in the slot/slot_base/functor_base prevents compiler from selecting move semantics for constructor. >> >> BR, Andrey >> _______________________________________________ >> >