Skip to main content Link Search Menu Expand Document (external link)

Template Specialisations Quiz

Question

Why cannot we use a single template function with specialisations to aggregate all numeric types?

Because floating point and integer types use different representations

Incorrect!

Because these types do not inherit from a common type

Correct!

Because the user could create their own numeric types that we couldn’t account for

Incorrect!

Because they use the C runtime, unlike bool and string which do not exist in C

Incorrect!