How do I force a particular instance of a C++ template to instantiate?

后端 未结 6 591
误落风尘
误落风尘 2020-11-29 23:07

See title. I have a template. I want to force a particular instance of a template to instantiate. How do I do this?

More specifically, can you force an abstract temp

6条回答
  •  [愿得一人]
    2020-11-29 23:41

    What you also can try is explicit instantiation:

    template class vector;                    // class
    template int& vector::operator[](int);    // member
    template int convert(double);      // function
    

提交回复
热议问题