mirror of
https://github.com/love2d/love.git
synced 2026-08-15 15:51:12 +02:00
Reduce template instantiations of std::vector<std::string>
The new StringMap code for luax_enumerror causes code to be generated for std::vector. By using an extern template (an old feature standardised in c++11) we can instantiate it once instead, in StringMap.cpp. --HG-- branch : minor
This commit is contained in:
@@ -26,6 +26,12 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// As StringMap instantiates std::vector<std::string> for instances that use
|
||||
// getNames(), we end up with multiple copies in the object files. This
|
||||
// declaration means we only emit it once (in StringMap.cpp).
|
||||
extern template class std::vector<std::string>;
|
||||
extern template decltype(std::vector<std::string>().emplace_back("")) std::vector<std::string>::emplace_back<const char *const&>(const char *const&);
|
||||
|
||||
namespace love
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user