Which of the following is not a legitimate reason to use function templates? 

  • To support multiple types with the same function logic 
  • To increase execution speed 
  • To reduce code size 
  • To create a list of unrelated types
Function templates are utilized primarily to enable generic programming, meaning writing code that works for multiple data types without repetition. While they may have indirect effects on execution speed or code size, using them to group unrelated types doesn't align with their primary purpose.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *