From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by sourceware.org (Postfix) with ESMTPS id 46B393858D28 for ; Fri, 24 Mar 2023 07:09:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 46B393858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=cs.washington.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.washington.edu Received: by mail-ot1-x32a.google.com with SMTP id k14-20020a9d700e000000b0069faa923e7eso450460otj.10 for ; Fri, 24 Mar 2023 00:09:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.washington.edu; s=goo201206; t=1679641758; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=gCQbzR5TxF8QTdADUQ1TT2GhXf7f2eDj3d8SC7V6KJo=; b=EYfGO0j6UwOAtk5kBsAj3AKkXUp0kyMXn+p4JVcC+OW783eG7t5An3+wqOuGSXyJ6k V3XWmvMRKrnnRlFVxsH7SiWVCXAByw9IWC6r++8gtKeP/oyFAkNepP+JJivT1RbsiEsx kf403jvNWVumcKZ6nHfw/Fpu9S2+wjSGnoYkA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679641758; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=gCQbzR5TxF8QTdADUQ1TT2GhXf7f2eDj3d8SC7V6KJo=; b=jTHOJ7OqSw/LgZs9Gub6kuIzy/HwjmLYtm6F5kgsa8k9JRPW/K8MdEhUYFB3HxRRvM U/cOwK3BhQgw9NGEFXVipPDCxFAVbUNToUS+TVhfJS8YWBVXHyYqVeOvwkRF5vZ4MBmE ndG34jHdLGD/D3gBVPD4sxV6nnPnYmp7RgpYzRyYE6oYJPNZKcn0rP4ApaIoBkPu4AAz 6vG/2bMjEXGlu9actM5KZ4U2lNwtjxuFsWJUlObjm0FolRU+UxMoLuSXz3GS59G2vKkw IqHP74Xm3mfNyEpKiXvhwoqFmRC+T3kOqVIfcTG6bc+gTg+KOpS13XV8nYkORD34wx7w 8nIg== X-Gm-Message-State: AO0yUKUVtEpLjhWNCsdFu1e8SbaBGXVj2juTvotEg1eF3n9iyNqdFQUW vkn8u62wGMcDcTsGJJGXTnxvikbQLRk4QbFRmlonum6763q9/qap8M4= X-Google-Smtp-Source: AKy350ZDsuJ38jk+3MARBomSMdyLuOPDsI88OhpwSkhYsztXXG8OFvNlP1qlBX6nMzutmU4oLtsdperHX1nIJhFGATU= X-Received: by 2002:a05:6130:3a9:b0:68d:6360:77b with SMTP id az41-20020a05613003a900b0068d6360077bmr1010173uab.1.1679641057349; Thu, 23 Mar 2023 23:57:37 -0700 (PDT) MIME-Version: 1.0 From: Ken Matsui Date: Thu, 23 Mar 2023 23:57:26 -0700 Message-ID: Subject: [GSoC] Question about Relatively Simple Library Traits To: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, I am working on the GSoC project, "C++: Implement compiler built-in traits for the standard library traits". I found the following library traits that I am not sure if implementing built-in traits brings reasonable speed up. * std::is_fundamental * std::is_arithmetic * std::is_scalar * std::is_object * std::is_compound * std::is_scoped_enum For example, std::is_object has no template specializations, but its inheriting class looks complicated. __not_<__or_, is_reference<_Tp>, is_void<_Tp>>>::type If we define the built-in trait for this trait, we have: (as equivalence of the above code) __bool_constant<__is_object(_Tp)> And __is_object built-in trait should be like: !(type1 == FUNCTION_TYPE || type1 == ...) In this case, could someone tell me which one would be faster? Or, is there no other way to know which but to benchmark? Sincerely, Ken Matsui