F
F
floppa3222022-01-18 13:44:29
C++ / C#
floppa322, 2022-01-18 13:44:29

When is narrowing conversion not implementation defined?

Hello everyone

Do I understand the rules of narrowing conversion correctly:

1. Wide type -> Narrow type. The resulting type fits the resulting value. For example, int32_t = uint64_t, value on the right <= maxValue of the value on the left. OK

2. Wide type -> Narrow type. Final type Does not fit the resulting value. For example, int32_t = uint64_t, value on the right > maxValue of the value on the left. Implementation defined

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question