Template Compilation

后端 未结 7 1942
鱼传尺愫
鱼传尺愫 2020-11-29 07:25

I have what could possibly be a dumb question, but I\'m just not understanding my book\'s explanation for it.

It says \"When the compiler sees the definition of a t

相关标签:
7条回答
  • 2020-11-29 08:10

    What is the compiler suppose to do when it sees a template? Generate all the machine code for all possible data types - ints, doubles, float, strings, ... Could take a lot of time. Or just be a little lazy and generate the machine code for what it requires.

    I guess the latter option is the better solution and gets the job done.

    0 讨论(0)
提交回复
热议问题