On 2010-08-27 15:59, joe wrote:
> Öö Tiib wrote:
>>
>> You are not forced to use arithmetic provided by language. You can
>> easily make your own numeric classes and their operations.
>
> Like MS's SafeInt, I know. But if it was built-in to the low level, there
> wouldn't be a need for those kinds of things. If people are doing it in
> programmer-land, then surely the compiler could do it more efficiently?
> And it doesn't have to be one way or the other, a new set of safe
> primitive integers could be added for those who want to use them.
Maybe in C, where they prefer to add things (such as _Complex) directly
to the core language, provided there is a sufficient demand, of course.
However, C++ prefers to focus on providing facilities upon which people
can build things they want; e.g. classes and templates instead of _Complex.
--
Seungbeom Kim
|