admin管理员组文章数量:1122832
I am using a C++ std::variant
with around 100 structs as possible choices. This type is used throughout my application and compile times tend to point to the instantiation and generation of various std::variant
methods:
e.g.
Wall Duration 18,560.314 ms
Args
detail
"std::__variant_detail::__dtor.......
Of course there are also 100's to TU's that need this definition, so my compile times are getting quite high.
With templates I'm familiar with instantiating the template in a TU for example
template class MyClass<XXX>;
Can I do a similar thing for the variant
? How do I make other TU's depend on these symbols being linked in? Can I do this in a Precompiled header perhaps?
本文标签: cPrecompile stdvariant instantiationStack Overflow
版权声明:本文标题:c++ - Precompile std::variant instantiation? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736300161a1930718.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论