From 98c66543c7159b84f89f0f94b3db2bbda0f8e06a Mon Sep 17 00:00:00 2001
From: Jan Travnicek <Jan.Travnicek@fit.cvut.cz>
Date: Fri, 4 Aug 2017 11:18:23 +0200
Subject: [PATCH] rename type_name to to_string

---
 acast2/src/acast.cpp                          |  2 +-
 alib2cli/src/ast/statements/SingleStatement.h |  2 +-
 .../src/abstraction/AlgorithmAbstraction.hpp  |  4 +--
 .../src/abstraction/AlgorithmRegistry.hpp     |  2 +-
 alib2common/src/abstraction/CastRegistry.hpp  |  8 ++---
 .../src/abstraction/DowncastRegistry.hpp      |  4 +--
 .../src/abstraction/ImmediateRegistry.hpp     |  2 +-
 .../src/abstraction/NormalizeRegistry.hpp     |  2 +-
 .../src/abstraction/PrimitiveRegistrator.cpp  |  2 +-
 .../abstraction/UnaryOperationAbstraction.hpp |  4 +--
 .../abstraction/ValueOperationAbstraction.hpp | 12 +++----
 .../src/abstraction/ValuePrinterRegistry.hpp  |  2 +-
 .../src/abstraction/XmlFileWriterRegistry.hpp |  2 +-
 alib2common/src/core/castApi.hpp              | 10 +++---
 alib2common/src/core/components.hpp           |  6 ++--
 alib2common/src/core/multipleDispatch.hpp     | 18 +++++-----
 alib2common/src/core/xmlApi.hpp               | 18 +++++-----
 alib2common/src/introspection/Algorithms.hpp  | 12 +++----
 alib2common/src/introspection/Casts.hpp       |  4 +--
 alib2common/src/introspection/DataTypes.hpp   |  6 ++--
 alib2std/src/extensions/string.cpp            | 33 ++++++++++++++++++-
 alib2std/src/extensions/string.hpp            | 29 +++++++++++-----
 alib2std/src/extensions/typeindex.cpp         | 10 ++++--
 alib2std/src/extensions/typeindex.h           | 10 ++++--
 alib2std/src/extensions/typeinfo.cpp          | 12 ++++---
 alib2std/src/extensions/typeinfo.hpp          | 18 ++++++----
 alib2std/test-src/extensions/StringTest.cpp   |  1 -
 27 files changed, 148 insertions(+), 87 deletions(-)

diff --git a/acast2/src/acast.cpp b/acast2/src/acast.cpp
index 25bd0c26fc..6fe5f611fa 100644
--- a/acast2/src/acast.cpp
+++ b/acast2/src/acast.cpp
@@ -26,7 +26,7 @@ alib::Object doCast ( const alib::Object & in, const std::string & to ) {
 		if ( alib::castApi::getCastPool ( toType ).castAvailable ( inType ) )
 			return alib::castApi::getCastPool ( toType ).cast ( inObject );
 
-	throw exception::CommonException ( "Cast from " + std::type_name ( inType ) + " to " + to + " not available" );
+	throw exception::CommonException ( "Cast from " + ext::to_string ( inType ) + " to " + to + " not available" );
 }
 
 int main(int argc, char** argv) {
diff --git a/alib2cli/src/ast/statements/SingleStatement.h b/alib2cli/src/ast/statements/SingleStatement.h
index 54a51cb36f..11de57e28d 100644
--- a/alib2cli/src/ast/statements/SingleStatement.h
+++ b/alib2cli/src/ast/statements/SingleStatement.h
@@ -34,7 +34,7 @@ public:
 		unsigned i = 0;
 		for ( const std::shared_ptr < abstraction::OperationAbstraction > & param : params ) {
 			if ( ! algo->attachInput ( param, i ) )
-				throw exception::CommonException ( "Can't connect param at " + ext::to_string ( i ) + " of algorithm " + m_name + " with result of type " + std::type_name ( param->type ( ) ) + "." );
+				throw exception::CommonException ( "Can't connect param at " + ext::to_string ( i ) + " of algorithm " + m_name + " with result of type " + ext::to_string ( param->type ( ) ) + "." );
 			i++;
 		}
 
diff --git a/alib2common/src/abstraction/AlgorithmAbstraction.hpp b/alib2common/src/abstraction/AlgorithmAbstraction.hpp
index 273789b692..bf1a0e5502 100644
--- a/alib2common/src/abstraction/AlgorithmAbstraction.hpp
+++ b/alib2common/src/abstraction/AlgorithmAbstraction.hpp
@@ -113,7 +113,7 @@ public:
 
 	virtual std::shared_ptr < OperationAbstraction > getImmediateValueFromParam ( unsigned index, const std::string & value ) const override {
 		auto callback = [ & ] ( auto & param ) {
-			std::string paramType = std::type_name < typename std::decay < decltype ( param ) >::type::element_type::return_type > ( );
+			std::string paramType = ext::to_string < typename std::decay < decltype ( param ) >::type::element_type::return_type > ( );
 			return Registry::getImmediateAbstraction ( std::move ( paramType ), value );
 		};
 		return std::call_on_nth < std::shared_ptr < OperationAbstraction > > ( inputs, index, callback );
@@ -121,7 +121,7 @@ public:
 
 	virtual std::shared_ptr < OperationAbstraction > getXmlParserFromParam ( unsigned index, std::deque < sax::Token > tokens ) const override {
 		auto callback = [ & ] ( auto & param ) {
-			std::string paramType = std::type_name < typename std::decay < decltype ( param ) >::type::element_type::return_type > ( );
+			std::string paramType = ext::to_string < typename std::decay < decltype ( param ) >::type::element_type::return_type > ( );
 			return Registry::getXmlParserAbstraction ( std::move ( paramType ), std::move ( tokens ) );
 		};
 		return std::call_on_nth < std::shared_ptr < OperationAbstraction > > ( inputs, index, callback );
diff --git a/alib2common/src/abstraction/AlgorithmRegistry.hpp b/alib2common/src/abstraction/AlgorithmRegistry.hpp
index d0be14f639..0ffc10c83c 100644
--- a/alib2common/src/abstraction/AlgorithmRegistry.hpp
+++ b/alib2common/src/abstraction/AlgorithmRegistry.hpp
@@ -69,7 +69,7 @@ class AlgorithmRegistry {
 public:
 	template < class Algo, class ReturnType, class ... ParamTypes >
 	static void registerAlgorithm ( ReturnType ( * callback ) ( ParamTypes ... ), bool downcast, bool normalize ) {
-		std::string algorithm = std::type_name < Algo > ( );
+		std::string algorithm = ext::to_string < Algo > ( );
 
 		std::vector < std::type_index > params;
 		( void ) std::initializer_list < int > { ( params.push_back ( std::type_index ( typeid ( typename std::decay < ParamTypes >::type ) ) ), 0 ) ... };
diff --git a/alib2common/src/abstraction/CastRegistry.hpp b/alib2common/src/abstraction/CastRegistry.hpp
index f365c635a6..d98fe5d7db 100644
--- a/alib2common/src/abstraction/CastRegistry.hpp
+++ b/alib2common/src/abstraction/CastRegistry.hpp
@@ -56,8 +56,8 @@ public:
 
 	template < class TargetType, class ParamType >
 	static void registerCast ( ) {
-		std::string target = std::type_name < TargetType > ( );
-		std::string param = std::type_name < ParamType > ( );
+		std::string target = ext::to_string < TargetType > ( );
+		std::string param = ext::to_string < ParamType > ( );
 
 		registerCast < TargetType, ParamType > ( target, param );
 	}
@@ -70,8 +70,8 @@ public:
 
 	template < class TargetType, class ParamType >
 	static void registerCastAlgorithm ( TargetType ( * callback ) ( ParamType ) ) {
-		std::string target = std::type_name < TargetType > ( );
-		std::string param = std::type_name < ParamType > ( );
+		std::string target = ext::to_string < TargetType > ( );
+		std::string param = ext::to_string < ParamType > ( );
 
 		registerCastAlgorithm < TargetType, ParamType > ( target, param, callback );
 	}
diff --git a/alib2common/src/abstraction/DowncastRegistry.hpp b/alib2common/src/abstraction/DowncastRegistry.hpp
index 223fe6ced4..8d06eb4423 100644
--- a/alib2common/src/abstraction/DowncastRegistry.hpp
+++ b/alib2common/src/abstraction/DowncastRegistry.hpp
@@ -40,8 +40,8 @@ class DowncastRegistry {
 public:
 	template < class ConcreteType, class BaseType >
 	static void registerDowncast ( ) {
-		std::string concrete = std::type_name < ConcreteType > ( );
-		std::string base = std::type_name < BaseType > ( );
+		std::string concrete = ext::to_string < ConcreteType > ( );
+		std::string base = ext::to_string < BaseType > ( );
 		if ( ! getEntries ( ).insert ( std::make_pair ( std::make_pair ( concrete, base ), std::unique_ptr < Entry > ( new EntryImpl < ConcreteType, BaseType > ( ) ) ) ).second )
 			throw ::exception::CommonException ( "Downcasting for " + base + " to " + concrete + " already registered." );
 	}
diff --git a/alib2common/src/abstraction/ImmediateRegistry.hpp b/alib2common/src/abstraction/ImmediateRegistry.hpp
index e85b18c6e9..2c4e2a6101 100644
--- a/alib2common/src/abstraction/ImmediateRegistry.hpp
+++ b/alib2common/src/abstraction/ImmediateRegistry.hpp
@@ -48,7 +48,7 @@ public:
 
 	template < class ResultType >
 	static void registerImmediate ( ) {
-		std::string result = std::type_name < ResultType > ( );
+		std::string result = ext::to_string < ResultType > ( );
 		registerImmediate < ResultType > ( std::move ( result ) );
 	}
 
diff --git a/alib2common/src/abstraction/NormalizeRegistry.hpp b/alib2common/src/abstraction/NormalizeRegistry.hpp
index 45d4429f5f..8bc3c093b0 100644
--- a/alib2common/src/abstraction/NormalizeRegistry.hpp
+++ b/alib2common/src/abstraction/NormalizeRegistry.hpp
@@ -45,7 +45,7 @@ public:
 
 	template < class ParamType >
 	static void registerNormalize ( ) {
-		std::string param = std::type_name < ParamType > ( );
+		std::string param = ext::to_string < ParamType > ( );
 		registerNormalize < ParamType > ( std::move ( param ) );
 	}
 
diff --git a/alib2common/src/abstraction/PrimitiveRegistrator.cpp b/alib2common/src/abstraction/PrimitiveRegistrator.cpp
index eb4e8049c9..370bb4b32d 100644
--- a/alib2common/src/abstraction/PrimitiveRegistrator.cpp
+++ b/alib2common/src/abstraction/PrimitiveRegistrator.cpp
@@ -30,7 +30,7 @@ public:
 
 		abstraction::CastRegistry::registerCast < bool, int > ( );
 
-		abstraction::CastRegistry::registerCast < size_t, int > ( "size_t", std::type_name < int > ( ) );
+		abstraction::CastRegistry::registerCast < size_t, int > ( "size_t", ext::to_string < int > ( ) );
 		abstraction::CastRegistry::registerCast < size_t, int > ( );
 		abstraction::CastRegistry::registerCast < int, size_t > ( );
 
diff --git a/alib2common/src/abstraction/UnaryOperationAbstraction.hpp b/alib2common/src/abstraction/UnaryOperationAbstraction.hpp
index 01681e0ad6..6a5e5668cf 100644
--- a/alib2common/src/abstraction/UnaryOperationAbstraction.hpp
+++ b/alib2common/src/abstraction/UnaryOperationAbstraction.hpp
@@ -73,7 +73,7 @@ public:
 		if ( index != 0 )
 			throw std::out_of_range ( "Invalid input index" );
 
-		std::string paramType = std::type_name < ParamType > ( );
+		std::string paramType = ext::to_string < ParamType > ( );
 		return Registry::getImmediateAbstraction ( std::move ( paramType ), value );
 	}
 
@@ -81,7 +81,7 @@ public:
 		if ( index != 0 )
 			throw exception::CommonException ( "Out of range index: " + ext::to_string ( index ) + " max: " + ext::to_string ( numberOfParams ( ) ) + "." );
 
-		std::string paramType = std::type_name < ParamType > ( );
+		std::string paramType = ext::to_string < ParamType > ( );
 		return Registry::getXmlParserAbstraction ( std::move ( paramType ), std::move ( tokens ) );
 	}
 };
diff --git a/alib2common/src/abstraction/ValueOperationAbstraction.hpp b/alib2common/src/abstraction/ValueOperationAbstraction.hpp
index 85f5aa9c6a..bba6748cae 100644
--- a/alib2common/src/abstraction/ValueOperationAbstraction.hpp
+++ b/alib2common/src/abstraction/ValueOperationAbstraction.hpp
@@ -45,28 +45,28 @@ public:
 	}
 
 	virtual std::shared_ptr < OperationAbstraction > getXmlFileWriterFromResult ( const std::string & filename ) const override {
-		std::string param = std::type_name < ReturnType > ( );
+		std::string param = ext::to_string < ReturnType > ( );
 		return Registry::getXmlFileWriterAbstraction ( param, filename );
 	}
 
 	virtual std::shared_ptr < OperationAbstraction > getValuePrinterFromResult ( ) const override {
-		std::string param = std::type_name < ReturnType > ( );
+		std::string param = ext::to_string < ReturnType > ( );
 		return Registry::getValuePrinterAbstraction ( param );
 }
 
 	virtual std::shared_ptr < OperationAbstraction > getCastFromResult ( const std::string & target ) const override {
-		std::string param = std::type_name < ReturnType > ( );
+		std::string param = ext::to_string < ReturnType > ( );
 		return Registry::getCastAbstraction ( target, param );
 	}
 
 	virtual std::shared_ptr < OperationAbstraction > getNormalizeResult ( ) const override {
-		std::string param = std::type_name < ReturnType > ( );
+		std::string param = ext::to_string < ReturnType > ( );
 		return Registry::getNormalizeAbstraction ( param );
 	}
 
 	virtual std::shared_ptr < OperationAbstraction > getDowncastResult ( ) const override {
-		std::string base = std::type_name < ReturnType > ( );
-		std::string concrete = std::type_name ( runtime_type ( ) );
+		std::string base = ext::to_string < ReturnType > ( );
+		std::string concrete = ext::to_string ( runtime_type ( ) );
 		return Registry::getDowncastAbstraction ( concrete, base );
 	}
 
diff --git a/alib2common/src/abstraction/ValuePrinterRegistry.hpp b/alib2common/src/abstraction/ValuePrinterRegistry.hpp
index e18ceb73ec..3f87c784b2 100644
--- a/alib2common/src/abstraction/ValuePrinterRegistry.hpp
+++ b/alib2common/src/abstraction/ValuePrinterRegistry.hpp
@@ -45,7 +45,7 @@ public:
 
 	template < class ParamType >
 	static void registerValuePrinter ( ) {
-		std::string param = std::type_name < ParamType > ( );
+		std::string param = ext::to_string < ParamType > ( );
 		registerValuePrinter < ParamType > ( std::move ( param ) );
 	}
 
diff --git a/alib2common/src/abstraction/XmlFileWriterRegistry.hpp b/alib2common/src/abstraction/XmlFileWriterRegistry.hpp
index 26ab05b9a5..fcf1f7fcae 100644
--- a/alib2common/src/abstraction/XmlFileWriterRegistry.hpp
+++ b/alib2common/src/abstraction/XmlFileWriterRegistry.hpp
@@ -45,7 +45,7 @@ public:
 
 	template < class ParamType >
 	static void registerXmlFileWriter ( ) {
-		std::string param = std::type_name < ParamType > ( );
+		std::string param = ext::to_string < ParamType > ( );
 		registerXmlFileWriter < ParamType > ( std::move ( param ) );
 	}
 
diff --git a/alib2common/src/core/castApi.hpp b/alib2common/src/core/castApi.hpp
index ca3cde212b..496a927009 100644
--- a/alib2common/src/core/castApi.hpp
+++ b/alib2common/src/core/castApi.hpp
@@ -35,7 +35,7 @@ private:
 			std::map < std::type_index, std::function < alib::Object ( const alib::ObjectBase & ) > >::iterator res = castFunctions.find ( std::type_index ( typeid ( from ) ) );
 
 			if ( res == castFunctions.end ( ) ) {
-				std::string fromType = std::type_name ( typeid ( from ) );
+				std::string fromType = ext::to_string ( typeid ( from ) );
 
 				throw exception::CommonException ( "Bad cast: From: " + fromType + " To: " + toType ( ) );
 			}
@@ -58,8 +58,8 @@ private:
 					return alib::Object ( castFunction ( static_cast < const From & > ( from ) ) );
 				} ) ).second;
 			if ( ! res ) {
-				std::string fromName = std::type_name < From > ( );
-				std::string toName = std::type_name < To > ( );
+				std::string fromName = ext::to_string < From > ( );
+				std::string toName = ext::to_string < To > ( );
 
 				throw::exception::CommonException ( "Casting from " + fromName + " to " + toName + " already registered." );
 			}
@@ -86,7 +86,7 @@ private:
 		}
 
 		std::string toType ( ) {
-			return std::type_name < To > ( );
+			return ext::to_string < To > ( );
 		}
 
 	};
@@ -113,7 +113,7 @@ public:
 		std::map < std::type_index, CastPoolBase * >::iterator res = castFunctionsById ( ).find ( typeId );
 
 		if ( res == castFunctionsById ( ).end ( ) ) {
-			std::string toType = std::type_name ( typeId );
+			std::string toType = ext::to_string ( typeId );
 
 			throw exception::CommonException ( "Casting to type " + toType + " not available." );
 		} else {
diff --git a/alib2common/src/core/components.hpp b/alib2common/src/core/components.hpp
index a091521496..80df73fe9a 100644
--- a/alib2common/src/core/components.hpp
+++ b/alib2common/src/core/components.hpp
@@ -74,7 +74,7 @@ class Component {
 		ComponentConstraint < Derived, DataType, SetType >::valid ( static_cast < const Derived & > ( * this ), symbol );
 
 		if ( !ComponentConstraint < Derived, DataType, SetType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) {
-			std::string elementTypeName ( std::type_name < SetType * > ( ) );
+			std::string elementTypeName ( ext::to_string < SetType * > ( ) );
 			elementTypeName.back ( ) = ' ';
 			throw::exception::CommonException ( elementTypeName + "element " + ext::to_string ( symbol ) + " is not available." );
 		}
@@ -86,7 +86,7 @@ class Component {
 	 */
 	void checkRemove ( const DataType & symbol ) {
 		if ( ComponentConstraint < Derived, DataType, SetType >::used ( static_cast < const Derived & > ( * this ), symbol ) ) {
-			std::string elementTypeName ( std::type_name < SetType * > ( ) );
+			std::string elementTypeName ( ext::to_string < SetType * > ( ) );
 			elementTypeName.back ( ) = ' ';
 			throw::exception::CommonException ( elementTypeName + "element " + ext::to_string ( symbol ) + " is used." );
 		}
@@ -239,7 +239,7 @@ class Element {
 		ElementConstraint < Derived, DataType, ElementType >::valid ( static_cast < const Derived & > ( * this ), symbol );
 
 		if ( !ElementConstraint < Derived, DataType, ElementType >::available ( static_cast < const Derived & > ( * this ), symbol ) ) {
-			std::string elementTypeName ( std::type_name < ElementType * > ( ) );
+			std::string elementTypeName ( ext::to_string < ElementType * > ( ) );
 			elementTypeName.back ( ) = ' ';
 			throw::exception::CommonException ( elementTypeName + ext::to_string ( symbol ) + " is not available." );
 		}
diff --git a/alib2common/src/core/multipleDispatch.hpp b/alib2common/src/core/multipleDispatch.hpp
index 4219fee190..4d63a26ec8 100644
--- a/alib2common/src/core/multipleDispatch.hpp
+++ b/alib2common/src/core/multipleDispatch.hpp
@@ -79,9 +79,9 @@ public:
 
 		if ( ! res ) {
 			std::stringstream ss;
-			( void ) std::initializer_list < int > { ( ss << std::type_name < typename std::match_cv_ref < DispatchedParameterTypes, RealParameterTypeBases >::type > ( ), 0 ) ... };
+			( void ) std::initializer_list < int > { ( ss << ext::to_string < typename std::match_cv_ref < DispatchedParameterTypes, RealParameterTypeBases >::type > ( ), 0 ) ... };
 
-			std::string classType = std::type_name < Algorithm > ( );
+			std::string classType = ext::to_string < Algorithm > ( );
 
 			throw::exception::CommonException ( "Callback for " + ss.str ( ) + " already registered on " + classType + "." );
 		}
@@ -92,9 +92,9 @@ public:
 
 		if ( callback == getInstance ( ).registeredFunctions.end ( ) ) {
 			std::stringstream ss;
-			( void ) std::initializer_list < int > { ( ss << std::type_name ( typeid ( dispatched ) ), 0 ) ... };
+			( void ) std::initializer_list < int > { ( ss << ext::to_string ( typeid ( dispatched ) ), 0 ) ... };
 
-			std::string classType = std::type_name < Algorithm > ( );
+			std::string classType = ext::to_string < Algorithm > ( );
 
 			throw::exception::CommonException ( "Callback for " + ss.str ( ) + " not registered on " + classType + "." );
 		}
@@ -190,9 +190,9 @@ public:
 
 		bool res = getInstance ( ).registeredFunctions.insert ( std::make_pair ( std::type_index ( typeid ( typename std::match_cv_ref < ParametersType, RealParametersTypeBase >::type ) ), std::move ( value ) ) ).second;
 		if ( ! res ) {
-			std::string paramsType = std::type_name < typename std::match_cv_ref < ParametersType, RealParametersTypeBase >::type > ( );
+			std::string paramsType = ext::to_string < typename std::match_cv_ref < ParametersType, RealParametersTypeBase >::type > ( );
 
-			std::string classType = std::type_name < Algorithm > ( );
+			std::string classType = ext::to_string < Algorithm > ( );
 
 			throw::exception::CommonException ( "Callback for " + paramsType + " already registered on " + classType + "." );
 		}
@@ -209,11 +209,11 @@ public:
 		if ( ( callback != getInstance ( ).registeredFunctions.end ( ) ) && callback->second->available ( false, std::type_index ( typeid ( first ) ), std::type_index ( typeid ( second ) ) ) )
 			return callback->second->eval ( false, std::forward < ParametersType > ( first ), std::forward < ParametersType > ( second ) );
 
-		std::string firstType = std::type_name ( typeid ( first ) );
+		std::string firstType = ext::to_string ( typeid ( first ) );
 
-		std::string secondType = std::type_name ( typeid ( second ) );
+		std::string secondType = ext::to_string ( typeid ( second ) );
 
-		std::string classType = std::type_name < Algorithm > ( );
+		std::string classType = ext::to_string < Algorithm > ( );
 
 		throw::exception::CommonException ( "Callback for (" + firstType + ", " + secondType + ") (promoting) not registered on " + classType + "." );
 	}
diff --git a/alib2common/src/core/xmlApi.hpp b/alib2common/src/core/xmlApi.hpp
index b28e5c651c..7e30172b56 100644
--- a/alib2common/src/core/xmlApi.hpp
+++ b/alib2common/src/core/xmlApi.hpp
@@ -133,8 +133,8 @@ public:
 	static void registerType ( ) {
 		bool res = parseFunctions ( ).insert ( std::make_pair ( xmlApi < Type >::xmlTagName(), std::unique_ptr < GroupParser > ( new ParserRegister < Type > ( ) ) ) ).second;
 		if ( ! res ) {
-			std::string groupName = std::type_name < Group > ( );
-			std::string typeName = std::type_name < Type > ( );
+			std::string groupName = ext::to_string < Group > ( );
+			std::string typeName = ext::to_string < Type > ( );
 
 			throw::exception::CommonException ( "Parse callback of " + typeName + " already registered in group " + groupName + "." );
 		}
@@ -151,9 +151,9 @@ public:
 			int id = ext::from_string < int > ( sax::FromXMLParserHelper::popTokenData ( input, sax::Token::TokenType::CHARACTER ) );
 			sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ATTRIBUTE, "id" );
 			sax::FromXMLParserHelper::popToken ( input, sax::Token::TokenType::END_ELEMENT, "Ref" );
-			std::map < int, WrapperBaseBase * >::iterator elem = input.idToInstance ( std::type_name < Group > ( ) ).find ( id );
+			std::map < int, WrapperBaseBase * >::iterator elem = input.idToInstance ( ext::to_string < Group > ( ) ).find ( id );
 
-			if ( elem == input.idToInstance ( std::type_name < Group > ( ) ).end ( ) ) {
+			if ( elem == input.idToInstance ( ext::to_string < Group > ( ) ).end ( ) ) {
 				std::cerr << input.dump ( ) << std::endl;
 				throw exception::CommonException ( "XML Inconsistent ( id not found " + ext::to_string ( id  ) + " )" );
 			}
@@ -176,7 +176,7 @@ public:
 
 			/* if object is a base of reference, register it */
 			if ( ref )
-				input.idToInstance ( std::type_name < Group > ( ) ).insert ( std::make_pair ( id, ( WrapperBaseBase * ) new Group ( res ) ) );
+				input.idToInstance ( ext::to_string < Group > ( ) ).insert ( std::make_pair ( id, ( WrapperBaseBase * ) new Group ( res ) ) );
 
 			return res;
 		}
@@ -195,7 +195,7 @@ public:
 	}
 
 	static std::string xmlTagName ( ) {
-		std::string target = std::type_name < Group > ( );
+		std::string target = ext::to_string < Group > ( );
 
 		throw ::exception::CommonException ( "Type " + target + " does not have xmlTagName." );
 	}
@@ -203,9 +203,9 @@ public:
 	static void compose ( std::deque < sax::Token > & output, const Group & data ) {
 		xmlApiOutputContext & context = ( xmlApiOutputContext & ) output;
 
-		typename std::map < const CommonBaseBase *, int >::iterator elem = context.instanceToId ( std::type_name < Group > ( ) ).find ( static_cast < const CommonBaseBase * > ( & data.getData ( ) ) );
+		typename std::map < const CommonBaseBase *, int >::iterator elem = context.instanceToId ( ext::to_string < Group > ( ) ).find ( static_cast < const CommonBaseBase * > ( & data.getData ( ) ) );
 
-		if ( common::GlobalData::optimizeXml && elem != context.instanceToId ( std::type_name < Group > ( ) ).end ( ) ) {
+		if ( common::GlobalData::optimizeXml && elem != context.instanceToId ( ext::to_string < Group > ( ) ).end ( ) ) {
 			output.emplace_back ( "Ref", sax::Token::TokenType::START_ELEMENT );
 			output.emplace_back ( "id", sax::Token::TokenType::START_ATTRIBUTE );
 			output.emplace_back ( ext::to_string ( elem->second ), sax::Token::TokenType::CHARACTER );
@@ -228,7 +228,7 @@ public:
 				output.emplace ( output.begin ( ) + pos + 2, ext::to_string ( id ), sax::Token::TokenType::CHARACTER );
 				output.emplace ( output.begin ( ) + pos + 3, "ref", sax::Token::TokenType::END_ATTRIBUTE );
 
-				context.instanceToId ( std::type_name < Group > ( ) ).insert ( std::make_pair ( static_cast< const CommonBaseBase * > ( & data.getData ( ) ), id ) );
+				context.instanceToId ( ext::to_string < Group > ( ) ).insert ( std::make_pair ( static_cast< const CommonBaseBase * > ( & data.getData ( ) ), id ) );
 			}
 		}
 	}
diff --git a/alib2common/src/introspection/Algorithms.hpp b/alib2common/src/introspection/Algorithms.hpp
index f504724741..225e5e92c3 100644
--- a/alib2common/src/introspection/Algorithms.hpp
+++ b/alib2common/src/introspection/Algorithms.hpp
@@ -40,7 +40,7 @@ class Algorithms {
 	class TypesToString < std::tuple < Types ... > > {
 	public:
 		static const std::vector < std::string > & getTypes ( ) {
-			static std::vector < std::string > res { std::type_name < Types > ( ) ... };
+			static std::vector < std::string > res { ext::to_string < Types > ( ) ... };
 
 			return res;
 		}
@@ -62,16 +62,16 @@ public:
 	template < class Algorithm, class RealReturnType, class RealParameterTypes >
 	static void registerDispatchInAlgorithm ( ) {
 		std::vector < std::string > realParameterTypeNames = TypesToString < RealParameterTypes >::getTypes ( );
-		std::string algorithm = std::type_name < Algorithm > ( );
-		std::string realReturnType = std::type_name < RealReturnType > ( );
+		std::string algorithm = ext::to_string < Algorithm > ( );
+		std::string realReturnType = ext::to_string < RealReturnType > ( );
 
 		Algorithms::algorithmCallbacks ( ) [ std::move ( algorithm ) ].insert ( std::make_tuple ( std::move ( realReturnType ), std::move ( realParameterTypeNames ) ) );
 	}
 
 	template < class Algorithm, class ReturnType, class FrontStaticParamTypes, class DispatchedParameterTypes, class BackStaticParamTypes >
 	static void registerAlgorithmInterface ( ) {
-		std::string algorithm = std::type_name < Algorithm > ( );
-		std::string returnType = std::type_name < ReturnType > ( );
+		std::string algorithm = ext::to_string < Algorithm > ( );
+		std::string returnType = ext::to_string < ReturnType > ( );
 		std::vector < std::string > frontStaticParamTypeNames = TypesToString < FrontStaticParamTypes >::getTypes ( );
 		std::vector < std::string > dispatchedParameterTypeNames = TypesToString < DispatchedParameterTypes >::getTypes ( );
 		std::vector < std::string > backStaticParamTypeNames = TypesToString < BackStaticParamTypes >::getTypes ( );
@@ -81,7 +81,7 @@ public:
 
 	template < class Algorithm >
 	static void registerAlgorithm ( ) {
-		std::string algorithm = std::type_name < Algorithm > ( );
+		std::string algorithm = ext::to_string < Algorithm > ( );
 
 		Algorithms::algorithms ( ).insert ( std::move ( algorithm ) );
 	}
diff --git a/alib2common/src/introspection/Casts.hpp b/alib2common/src/introspection/Casts.hpp
index f1c6a0af55..3faa7f4980 100644
--- a/alib2common/src/introspection/Casts.hpp
+++ b/alib2common/src/introspection/Casts.hpp
@@ -37,8 +37,8 @@ public:
 
 	template < class From, class To >
 	static void registerCast ( ) {
-		std::string fromType = std::type_name < From > ( );
-		std::string toType = std::type_name < To > ( );
+		std::string fromType = ext::to_string < From > ( );
+		std::string toType = ext::to_string < To > ( );
 
 		std::set < std::string > & fromToSet = Casts::castsFrom ( ) [ fromType ];
 		std::set < std::string > & toFromSet = Casts::castsTo ( ) [ toType ];
diff --git a/alib2common/src/introspection/DataTypes.hpp b/alib2common/src/introspection/DataTypes.hpp
index 9f71c530bc..f67a2c1e9d 100644
--- a/alib2common/src/introspection/DataTypes.hpp
+++ b/alib2common/src/introspection/DataTypes.hpp
@@ -37,15 +37,15 @@ public:
 
 	template < class Type, class Group >
 	static void registerTypeInGroup ( ) {
-		std::string type = std::type_name < Type > ( );
-		std::string group = std::type_name < Group > ( );
+		std::string type = ext::to_string < Type > ( );
+		std::string group = ext::to_string < Group > ( );
 
 		DataTypes::typesInGroup ( ) [ group ].insert ( std::move ( type ) );
 	}
 
 	template < class Group >
 	static void registerGroup ( ) {
-		std::string group = std::type_name < Group > ( );
+		std::string group = ext::to_string < Group > ( );
 
 		DataTypes::groups ( ).insert ( std::move ( group ) );
 	}
diff --git a/alib2std/src/extensions/string.cpp b/alib2std/src/extensions/string.cpp
index ba99bf1642..42937a3800 100644
--- a/alib2std/src/extensions/string.cpp
+++ b/alib2std/src/extensions/string.cpp
@@ -10,11 +10,42 @@
 
 namespace ext {
 
-template < >
 std::string to_string ( const std::string & value ) {
 	return value;
 }
 
+std::string to_string ( int value ) {
+	return std::to_string__private ( value );
+}
+
+std::string to_string ( bool value ) {
+	return std::to_string__private ( value );
+}
+
+std::string to_string ( long value ) {
+	return std::to_string__private ( value );
+}
+
+std::string to_string ( long long value ) {
+	return std::to_string__private ( value );
+}
+
+std::string to_string ( unsigned value ) {
+	return std::to_string__private ( value );
+}
+
+std::string to_string ( unsigned long value ) {
+	return std::to_string__private ( value );
+}
+
+std::string to_string ( unsigned long long value ) {
+	return std::to_string__private ( value );
+}
+
+std::string to_string ( double value ) {
+	return std::to_string__private ( value );
+}
+
 template < >
 std::string from_string ( const std::string & value ) {
 	return value;
diff --git a/alib2std/src/extensions/string.hpp b/alib2std/src/extensions/string.hpp
index 191d6be9dc..370ea85a02 100644
--- a/alib2std/src/extensions/string.hpp
+++ b/alib2std/src/extensions/string.hpp
@@ -14,22 +14,33 @@
 
 namespace ext {
 
-template<typename... Ts>
-using to_string_type = auto(Ts...) -> decltype(std::to_string__private(std::declval<Ts>()...));
-
-template < typename T, typename std::enable_if < std::is_function< to_string_type < T > >::value >::type* = nullptr >
-std::string to_string ( T value ) {
-	return std::to_string__private ( value );
-}
-
 template < typename T, typename std::enable_if < std::is_constructible < std::string, T >::value >::type* = nullptr >
 std::string to_string ( const T & value ) {
 	return (std::string) value;
 }
 
-template < >
 std::string to_string ( const std::string & value );
 
+std::string to_string ( int value );
+
+std::string to_string ( bool value );
+
+std::string to_string ( long value );
+
+std::string to_string ( long long value );
+
+std::string to_string ( unsigned value );
+
+std::string to_string ( unsigned long value );
+
+std::string to_string ( unsigned long long value );
+
+std::string to_string ( double value );
+
+
+
+
+
 template < typename T >
 T from_string ( const std::string & );
 
diff --git a/alib2std/src/extensions/typeindex.cpp b/alib2std/src/extensions/typeindex.cpp
index 73518eb991..cf59e91357 100644
--- a/alib2std/src/extensions/typeindex.cpp
+++ b/alib2std/src/extensions/typeindex.cpp
@@ -13,11 +13,15 @@
 namespace std {
 
 std::ostream & operator << ( std::ostream & os, const std::type_index & type ) {
-	os << std::type_name ( type );
+	os << ext::to_string ( type );
 	return os;
 }
 
-std::string type_name(const std::type_index& type) {
+} /* namespace std */
+
+namespace ext {
+
+std::string to_string ( const std::type_index & type ) {
 	int status;
 
 	char* demangled = abi::__cxa_demangle(type.name(), 0, 0, &status);
@@ -26,4 +30,4 @@ std::string type_name(const std::type_index& type) {
 	return res;
 }
 
-} /* namespace std */
+} /* namespace ext */
diff --git a/alib2std/src/extensions/typeindex.h b/alib2std/src/extensions/typeindex.h
index 70026e9f61..c698f0c968 100644
--- a/alib2std/src/extensions/typeindex.h
+++ b/alib2std/src/extensions/typeindex.h
@@ -11,6 +11,8 @@
 #include <typeindex>
 #include <iostream>
 
+#include "string.hpp"
+
 namespace std {
 
 inline int operator -( const std::type_index & first, const std::type_index & second ) {
@@ -19,8 +21,12 @@ inline int operator -( const std::type_index & first, const std::type_index & se
 
 std::ostream & operator << ( std::ostream & os, const std::type_index & type );
 
-std::string type_name(const std::type_index& type);
-
 } /* namespace std */
 
+namespace ext {
+
+std::string to_string ( const std::type_index & type );
+
+} /* namespace ext */
+
 #endif /* __TYPEINDEX_H_ */
diff --git a/alib2std/src/extensions/typeinfo.cpp b/alib2std/src/extensions/typeinfo.cpp
index 536e56c733..3ce04b1524 100644
--- a/alib2std/src/extensions/typeinfo.cpp
+++ b/alib2std/src/extensions/typeinfo.cpp
@@ -9,14 +9,18 @@
 #include <typeindex>
 #include <iostream>
 
-namespace std {
+namespace ext {
 
-std::string type_name(const std::type_info& type) {
-	return type_name ( std::type_index ( type ) );
+std::string to_string ( const std::type_info & type ) {
+	return to_string ( std::type_index ( type ) );
 }
 
+} /* namespace ext */
+
+namespace std {
+
 std::ostream & operator << ( std::ostream & os, const std::type_info & type ) {
-	os << std::type_name ( type );
+	os << ext::to_string ( type );
 	return os;
 }
 
diff --git a/alib2std/src/extensions/typeinfo.hpp b/alib2std/src/extensions/typeinfo.hpp
index 44fa8ced41..351ced252b 100644
--- a/alib2std/src/extensions/typeinfo.hpp
+++ b/alib2std/src/extensions/typeinfo.hpp
@@ -14,20 +14,22 @@
 #include <cstdio>
 #include <cstring>
 
-namespace std {
+#include "string.hpp"
+
+namespace ext {
 
-std::string type_name(const std::type_info& type);
+std::string to_string ( const std::type_info & type );
 
-template <class T>
-std::string type_name() {
-	return type_name(typeid(T));
+template < class T >
+std::string to_string ( ) {
+	return to_string (typeid(T));
 }
 
 template<typename T>
 bool is_same_type(const char* name) {
 	char namespaceId[100];
 	char classId[100];
-	std::string ret = type_name<T>();
+	std::string ret = to_string < T > ( );
 	sscanf(ret.c_str(), "%[a-zA-Z]::%[a-zA-Z]", namespaceId, classId);
 
 	if(strcmp(classId, name) == 0) {
@@ -37,6 +39,10 @@ bool is_same_type(const char* name) {
 	}
 }
 
+} /* namespace ext */
+
+namespace std {
+
 std::ostream & operator << ( std::ostream & os, const std::type_info & type );
 
 } /* namespace std */
diff --git a/alib2std/test-src/extensions/StringTest.cpp b/alib2std/test-src/extensions/StringTest.cpp
index 7b1155c67e..15368224cb 100644
--- a/alib2std/test-src/extensions/StringTest.cpp
+++ b/alib2std/test-src/extensions/StringTest.cpp
@@ -11,7 +11,6 @@ void StringTest::tearDown() {
 }
 
 void StringTest::testToString() {
-	CPPUNIT_ASSERT ( std::is_function< ext::to_string_type < int > >::value );
 	CPPUNIT_ASSERT ( ext::to_string ( std::string ( "1" ) ) == "1" );
 	CPPUNIT_ASSERT ( ext::to_string ( 1 ) == "1" );
 	CPPUNIT_ASSERT ( ext::to_string ( 1ul ) == "1" );
-- 
GitLab