本文介绍了C ++标准库中是否存在算术类型的概念?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我一直在浏览,但我无法找到算术类型的概念。我也在,于2019年7月...甚至添加了浮点概念的论文也没有提及算术

The standard library concepts were added by the Ranges proposal and were driven by needs in algorithms for certain concepts. integral comes up a lot, but I guess arithmetic never did and so it just never got added. If you look at, say, N4382 (from early 2015), you can see that Integral (and SignedIntegral and UnsignedIntegral) were there from the very beginning... whereas even FloatingPoint got added way later. (by P0631, in July 2019... and even the paper that added the floating point concept didn't make any mention of arithmetic)

当然,然后您会遇到一个有趣的问题,即它应该严格基于该类型特征还是应该 template< typename T>概念算术=积分T。 || float_point< T> ;; ,这样积分 floating_point 概念都包含算术。大概?也许?

Of course, then you get into the fun question of whether it should be based on strictly that type trait or should it be template <typename T> concept arithmetic = integral<T> || floating_point<T>; so that both the integral and floating_point concepts subsume arithmetic. Probably? Maybe?

这篇关于C ++标准库中是否存在算术类型的概念?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 10:06