From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lndn.lancelotsix.com (lndn.lancelotsix.com [51.195.220.111]) by sourceware.org (Postfix) with ESMTPS id 27FD33953C37 for ; Fri, 30 Jul 2021 17:47:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 27FD33953C37 Received: from ubuntu.lan (unknown [IPv6:2a02:390:9086::635]) by lndn.lancelotsix.com (Postfix) with ESMTPSA id DD3AA818FB; Fri, 30 Jul 2021 17:47:23 +0000 (UTC) Date: Fri, 30 Jul 2021 17:47:19 +0000 From: Lancelot SIX To: Simon Marchi Cc: Tom Tromey , Lancelot SIX via Gdb-patches Subject: Re: [PATCH 15/16] gdb: make cmd_list_element var an optional union Message-ID: <20210730174719.m5laswgu7ntv5lqx@ubuntu.lan> References: <20210714232112.wsn7pits6uuz3nf5@ubuntu.lan> <20210720230335.dcpfxbol2uwjre3b@Plymouth> <87sfzyci3i.fsf@tromey.com> <20210728204538.z3iqkcfp7yenehms@ubuntu.lan> <87eebhau75.fsf@tromey.com> <20210729201235.h4b7mbvzxu2rnckr@ubuntu.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (lndn.lancelotsix.com [0.0.0.0]); Fri, 30 Jul 2021 17:47:24 +0000 (UTC) X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2021 17:47:26 -0000 > > Would the get_string/set_string/get_int/set_int methods still assert > that the var_type matches the storage type accessed? I think that's > important to have. > > Simon Yes, I’ll maintain that. The thing I’ll drop it the assertion in foo.get() that checks that foo.type is one of [var_a, var_b]. The variadic template will go away, but it is the part that brings the most 'complexity' (i.e. verbose and not necessarily easy to read template code) but only to bring this restrictive assertion. The most important part that will remain are 1) the get/set functions that will help introduce callbacks later and 2) the check that the var_type and the cast are compatible. Lancelot.