From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20295 invoked by alias); 23 Aug 2019 19:53:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 20016 invoked by uid 89); 23 Aug 2019 19:53:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1392, states X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Aug 2019 19:53:09 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id x7NJqxFV014701 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 23 Aug 2019 15:53:04 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca x7NJqxFV014701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=default; t=1566589985; bh=3g9u8HhqafCfA6WXDc4ksOORo5vYMjcmEZ/8/2VTm6I=; h=Subject:To:References:From:Date:In-Reply-To:From; b=mWYok/ra7LYj6M49CNpHIoNfrKHGxtlWa4SfkyH4prrG6JCZiXSQsu1ObO4UEXMsS F9NnHcoir+phvWdYJiVBhnhW5hwlB1jZkocBiiztbKuKBfptbK676OViRMkis0aSTP 7qZnJbdO6A9E6zN0Vl+R4mD8Kmth8ZzFcfHBxnI0= Received: from [172.16.2.176] (wsip-184-188-36-2.sd.sd.cox.net [184.188.36.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 9E63B1EBE5; Fri, 23 Aug 2019 15:52:59 -0400 (EDT) Subject: Re: [PATCH] Remove some variables in favor of using gdb::optional To: Pedro Alves , gdb-patches@sourceware.org References: <20190804201023.25628-1-simon.marchi@polymtl.ca> <9b1cdf6d-baae-3a5e-c2ea-fcdf124b7a1b@redhat.com> <65a23d93-bf2e-de1a-9052-f6d75832c2a1@polymtl.ca> <697c3e3d-4f75-4fb2-685b-a6fa59c7a2a3@polymtl.ca> <5d2e7548-1303-ba42-6d67-93ab37f6577d@redhat.com> <829ab63c-55b0-07bc-1517-0efe9aeecc95@polymtl.ca> <5ce0fc27-657c-a48a-8544-150a2a82b12f@redhat.com> From: Simon Marchi Message-ID: <5994de6e-cb4b-2ec2-f6f9-1ee41da1827e@polymtl.ca> Date: Fri, 23 Aug 2019 19:53:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <5ce0fc27-657c-a48a-8544-150a2a82b12f@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00557.txt.bz2 On 2019-08-23 3:47 p.m., Pedro Alves wrote: > On 8/23/19 8:33 PM, Simon Marchi wrote: >> On 2019-08-23 11:35 a.m., Pedro Alves wrote: > >>> Would you like to run with this? >> >> So I wasn't sure about what the third state should be. I think it depends on >> the particular context. In different contexts, it could mean "unknown", "unspecified", >> "auto", "don't care", etc. There's no one-size word that fits all case, so I don't really >> like the idea of having just one word and have it represent poorly what we actually mean. >> >> That lead me to think, if we want to represent three states and if the states are >> specific to each use case, why not just define an enum and be explicit about it? > > That's a very good point actually. I agree and I'm convinced. > > Let's shelve the tribool idea until/if we find a better use for it. > >> >> A bit like why I prefer defining an explicit type with two fields rather than using >> std::pair: the "first" and "second" members are not very descriptive. > > Right, agreed, the fact that std::map/std::unordered_map searching returns pairs > is one of those things I hate the most about C++. > >> Here's a patch that does that. What do you think? > > I think I like it! Yay, less work for me! I'll run it through the buildbot and push it if it's all good. Thanks, Simon