Skip to content

Instantly share code, notes, and snippets.

@mantognini
Last active December 17, 2015 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mantognini/5530703 to your computer and use it in GitHub Desktop.
Save mantognini/5530703 to your computer and use it in GitHub Desktop.
Why adding `template class std::basic_string<int>;` in String.hpp doesn't work ?

LaurentGomila/SFML Issue #5

Why adding template class std::basic_string<int>; in String.hpp doesn't work ?

It create huge amount of duplicate symbols.

diff --git a/include/SFML/System/String.hpp b/include/SFML/System/String.hpp
index 080a809..81e84c4 100644
--- a/include/SFML/System/String.hpp
+++ b/include/SFML/System/String.hpp
@@ -33,6 +33,9 @@
#include <string>
+template class std::basic_string<sf::Uint32>;
+
+
namespace sf
{
////////////////////////////////////////////////////////////
diff --git a/src/SFML/System/String.cpp b/src/SFML/System/String.cpp
index b4ee135..9a529b7 100644
--- a/src/SFML/System/String.cpp
+++ b/src/SFML/System/String.cpp
@@ -30,6 +30,8 @@
#include <iterator>
#include <cstring>
+extern template class std::basic_string<sf::Uint32>;
+
namespace sf
{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment