38 ms·
> Redundant definitions of templated functions which didn't get inlined always get dropped at link time. I wonder how many things aren't aggressively inlined i
by coroutines 11y ago
> Redundant definitions of templated functions which didn't get inlined always get dropped at link time.
I wonder how many things aren't aggressively inlined in C++..
---
Are you saying `extern template` is used like a `#pragma once` just for the template? I thought it had a greater effect on linking. :(
My concern is that even if the generated object code for std::vector<int> and a binary-compatible type like std::vector<something> are deduplicated in your codebase, that same object code for that specialized type of vector probably exist in several different programs throughout my system. (as an example)
- pjmlp 11y agoThat is implementation specific behavior and changes even between versions of the same compiler. Has it should be, actually. Freezing inlining algorithms in a language specification hinders future optimization algorithms. Chandler Carruth has done quite a few interesting talks how the clang inliner works.