C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::arithmetic (concept)

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Wed, 16 Apr 2025 12:58:25 +0200
Hi Thomas, have you seen that posted code: > // customization point as per [namespace.std], with semantic requirements > template <typename T> > constexpr bool enable_arithmetic = false; > > template <typename T> > concept arithmetic = is_arithmetic_v<T> || enable_arithmetic<T>; I think that was meant as customizable concept (instead of tags). One can specialize the variable template for custom types and also specify, whether the variable template expects the exact type or also descendants.   -----Ursprüngliche Nachricht----- Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Mi 16.04.2025 11:15 Betreff:Re: [std-proposals] std::arithmetic (concept) An:std-proposals_at_[hidden]; CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>; On Tue, Apr 15, 2025 at 5:41 PM Jason McKesson wrote: > > If you want your concept to be extensible, for types to explicitly > opt-in, you can. I think you're talking about tags. class MyClass { public:    typedef int IsArithmetic; }; And I think maybe tags should be standardised, the default behaviour being that a tag is inherited by derived classes unless you mark it "final" as follows: class MyClass { public:    _Tag IsArithmetic : final;   // This one is not inherited by derived classes    _Tag IsNuclear;   // This one is inherited by derived classes }; -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals  

Received on 2025-04-16 11:04:43