C++ Logo

SG7

Advanced search

Subject: Re: type_traits vs value-based reflection world
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2020-11-02 10:11:46


>
> > A constexpr-based model for type traits should reduce the number of
> class
> > template instantiations needed during compilation. Instantiating classes
> > can be costly (in terms of analyses performed and memory required for
> > specializations). Calling a non-template constexpr function is
> relatively
> > cheap by comparison.
>
> Isn't there a more immediate reason for this? As far as I can see, it's
> not
> currently possible to splice in consteval functions that take meta::info,
> because the argument is not a constant expression. One can however call
> meta::is_arithmetic on it.
>
> E.g. https://cppx.godbolt.org/z/EG71jY
>

Good point. I'm putting the cart before the horse here (I blame lack of
coffee). "Usable in more contexts" is better motivation than compiler
performance.

Andrew



SG7 list run by sg7-owner@lists.isocpp.org

Older Archives on Google Groups