Templates


  1. Why we use :: template-template parameter?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    It is used to adapt a policy into binary ones.


  1. What is a template?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    A template is a formula for creating a generic class



  1. Which of the things does not require instantiation?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    The compiler does not generate definitions for functions, non virtual member functions, class or member class because it does not require instantiation.


  1. Which parameter is legal for non-type template?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The following are legal for non-type template parameters:integral or enumeration type, Pointer to object or pointer to function, Reference to object or reference to function, Pointer to member.



  1. Pick out the correct statement about string template.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Every string template is used to replace the string with another string at runtime.