Templates


  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. 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 the validity of template parameters?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    inside that block only


  1. Which keyword can be used in template?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    both class & typename



  1. Which are done by compiler for templates?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    The compiler can determine at compile time whether the type associated with a template definition can perform all of the functions required by that template definition.