Index: code/branches/core3/src/util/Convert.h
===================================================================
--- code/branches/core3/src/util/Convert.h	(revision 1778)
+++ code/branches/core3/src/util/Convert.h	(revision 1779)
@@ -135,28 +135,20 @@
 ///////////////////
 
-// Default template for fallbackConvert, no conversion possible
-template <class ToType, class FromType>
-inline bool fallbackConversion(ToType* output, FromType input)
-{
-    COUT(2) << "Could not convert value of type " << typeid(FromType).name()
-            << " to type " << typeid(ToType).name() << std::endl;
-    return false;
-}
-
-
-/////////////////////
-// fallbackConvert //
-/////////////////////
-
-// Class template used when << or >> was not available with string conversions
-// It is required to call not yet declared fallbackConvert functions.
-template <class ToType, class FromType>
-struct ConverterFallbackTemplate
+// Default template. No conversion available at all.
+template <class ToType, class FromType>
+struct ConverterFallback
 {
     static bool convert(ToType* output, const FromType& input)
     {
-        return fallbackConversion(output, input);
-    }
-};
+        COUT(2) << "Could not convert value of type " << typeid(FromType).name()
+                << " to type " << typeid(ToType).name() << std::endl;
+        return false;
+    }
+};
+
+
+///////////////////////
+// ConverterFallback //
+///////////////////////
 
 // Default template for stringstream
@@ -166,5 +158,5 @@
     static bool convert(ToType* output, const FromType& input)
     {
-        return fallbackConversion(output, input);
+        return ConverterFallback<ToType, FromType>::convert(output, input);
     }
 };
@@ -181,5 +173,5 @@
     {
         std::string temp;
-        if (ConverterFallbackTemplate<std::string, FromType>::convert(&temp, input))
+        if (ConverterFallback<std::string, FromType>::convert(&temp, input))
         {
             std::operator <<(outstream, temp);
@@ -219,5 +211,5 @@
     inline bool operator >>(std::istream& instream, ToType& output)
     {
-        return ConverterFallbackTemplate<ToType, std::string>
+        return ConverterFallback<ToType, std::string>
             ::convert(&output, static_cast<std::istringstream&>(instream).str());
     }
@@ -246,4 +238,11 @@
 ///////////////////
 
+// static cast no possible, try stringstream conversion next
+template <class ToType, class FromType>
+inline bool convertImplicitely(ToType* output, const FromType& input, ::Int2Type<false>)
+{
+    return ConverterStringStream<ToType, FromType>::convert(output, input);
+}
+
 // We can cast implicitely
 template <class ToType, class FromType>
@@ -252,11 +251,4 @@
     (*output) = static_cast<ToType>(input);
     return true;
-}
-
-// static cast no possible, try stringstream conversion next
-template <class ToType, class FromType>
-inline bool convertImplicitely(ToType* output, const FromType& input, ::Int2Type<false>)
-{
-    return ConverterStringStream<ToType, FromType>::convert(output, input);
 }
 
@@ -266,20 +258,13 @@
 ///////////////////////
 
-template <class ToType, class FromType>
-inline bool explicitConversion(ToType* output, const FromType& input)
-{
-    // try implict conversion by probing first because we use '...' instead of a template
-    const bool probe = conversionTests::ImplicitConversion<FromType, ToType>::exists;
-    return convertImplicitely(output, input, ::Int2Type<probe>());
-}
-
-
-// Indirect calls over a class template so we can call functions not yet declared.
-template <class ToType, class FromType>
-struct ConverterExplicitTemplate
+// Default template if no specialisation is available
+template <class ToType, class FromType>
+struct ConverterExplicit
 {
     static bool convert(ToType* output, const FromType& input)
     {
-        return explicitConversion(output, input);
+        // try implict conversion by probing first because we use '...' instead of a template
+        const bool probe = conversionTests::ImplicitConversion<FromType, ToType>::exists;
+        return convertImplicitely(output, input, ::Int2Type<probe>());
     }
 };
@@ -302,5 +287,5 @@
 inline bool convertValue(ToType* output, const FromType& input)
 {
-    return ConverterExplicitTemplate<ToType, FromType>::convert(output, input);
+    return ConverterExplicit<ToType, FromType>::convert(output, input);
 }
 
@@ -368,36 +353,55 @@
 // delegate conversion from const char* to std::string
 template <class ToType>
-inline bool explicitConversion(ToType* output, const char* input)
-{
-    return convertValue<ToType, std::string>(output, input);
-}
+struct ConverterExplicit<ToType, const char*>
+{
+    static bool convert(ToType* output, const char* input)
+    {
+        return convertValue<ToType, std::string>(output, input);
+    }
+};
 
 // These conversions would exhibit ambiguous << or >> operators when using stringstream
-inline bool explicitConversion(std::string* output, const char input)
-{
-    *output = std::string(1, input);
-    return true;
-}
-inline bool explicitConversion(std::string* output, const unsigned char input)
-{
-    *output = std::string(1, input);
-    return true;
-}
-inline bool explicitConversion(char* output, const std::string input)
-{
-    if (input != "")
-        *output = input[0];
-    else
-        *output = '\0';
-    return true;
-}
-inline bool explicitConversion(unsigned char* output, const std::string input)
-{
-    if (input != "")
-        *output = input[0];
-    else
-        *output = '\0';
-    return true;
-}
+template <>
+struct ConverterExplicit<std::string, char>
+{
+    static bool convert(std::string* output, const char input)
+    {
+        *output = std::string(1, input);
+        return true;
+    }
+};
+template <>
+struct ConverterExplicit<std::string, unsigned char>
+{
+    static bool convert(std::string* output, const unsigned char input)
+    {
+        *output = std::string(1, input);
+        return true;
+    }
+};
+template <>
+struct ConverterExplicit<char, std::string>
+{
+    static bool convert(char* output, const std::string input)
+    {
+        if (input != "")
+            *output = input[0];
+        else
+            *output = '\0';
+        return true;
+    }
+};
+template <>
+struct ConverterExplicit<unsigned char, std::string>
+{
+    static bool convert(unsigned char* output, const std::string input)
+    {
+        if (input != "")
+            *output = input[0];
+        else
+            *output = '\0';
+        return true;
+    }
+};
 
 #endif /* _Convert_H__ */
Index: code/branches/core3/src/util/Math.cc
===================================================================
--- code/branches/core3/src/util/Math.cc	(revision 1778)
+++ code/branches/core3/src/util/Math.cc	(revision 1779)
@@ -130,10 +130,14 @@
 
 // std::string to Vector2
-bool fallbackConversion(orxonox::Vector2* output, const std::string& input)
-{
-    unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+bool ConverterFallback<orxonox::Vector2, std::string>::convert(orxonox::Vector2* output, const std::string& input)
+{
+    unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+    if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        opening_parenthesis = 0;
+    else
+        opening_parenthesis++;
+
+    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
+                     ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
     if (tokens.size() >= 2)
     {
@@ -149,10 +153,14 @@
 
 // std::string to Vector3
-bool fallbackConversion(orxonox::Vector3* output, const std::string& input)
-{
-    unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+bool ConverterFallback<orxonox::Vector3, std::string>::convert(orxonox::Vector3* output, const std::string& input)
+{
+    unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+    if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        opening_parenthesis = 0;
+    else
+        opening_parenthesis++;
+
+    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
+                     ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
     if (tokens.size() >= 3)
     {
@@ -170,5 +178,32 @@
 
 // std::string to Vector4
-bool fallbackConversion(orxonox::Vector4* output, const std::string& input)
+bool ConverterFallback<orxonox::Vector4, std::string>::convert(orxonox::Vector4* output, const std::string& input)
+{
+    unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
+    if ((opening_parenthesis = input.find('(')) == std::string::npos)
+        opening_parenthesis = 0;
+    else
+        opening_parenthesis++;
+
+    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis),
+                     ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
+    if (tokens.size() >= 4)
+    {
+        if (!ConvertValue(&(output->x), tokens[0]))
+            return false;
+        if (!ConvertValue(&(output->y), tokens[1]))
+            return false;
+        if (!ConvertValue(&(output->z), tokens[2]))
+            return false;
+        if (!ConvertValue(&(output->w), tokens[3]))
+            return false;
+
+        return true;
+    }
+    return false;
+}
+
+// std::string to Quaternion
+bool ConverterFallback<orxonox::Quaternion, std::string>::convert(orxonox::Quaternion* output, const std::string& input)
 {
     unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
@@ -178,20 +213,20 @@
     if (tokens.size() >= 4)
     {
-        if (!ConvertValue(&(output->x), tokens[0]))
-            return false;
-        if (!ConvertValue(&(output->y), tokens[1]))
-            return false;
-        if (!ConvertValue(&(output->z), tokens[2]))
-            return false;
-        if (!ConvertValue(&(output->w), tokens[3]))
-            return false;
-
-        return true;
-    }
-    return false;
-}
-
-// std::string to Quaternion
-bool fallbackConversion(orxonox::Quaternion* output, const std::string& input)
+        if (!ConvertValue(&(output->w), tokens[0]))
+            return false;
+        if (!ConvertValue(&(output->x), tokens[1]))
+            return false;
+        if (!ConvertValue(&(output->y), tokens[2]))
+            return false;
+        if (!ConvertValue(&(output->z), tokens[3]))
+            return false;
+
+        return true;
+    }
+    return false;
+}
+
+// std::string to ColourValue
+bool ConverterFallback<orxonox::ColourValue, std::string>::convert(orxonox::ColourValue* output, const std::string& input)
 {
     unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
@@ -201,27 +236,4 @@
     if (tokens.size() >= 4)
     {
-        if (!ConvertValue(&(output->w), tokens[0]))
-            return false;
-        if (!ConvertValue(&(output->x), tokens[1]))
-            return false;
-        if (!ConvertValue(&(output->y), tokens[2]))
-            return false;
-        if (!ConvertValue(&(output->z), tokens[3]))
-            return false;
-
-        return true;
-    }
-    return false;
-}
-
-// std::string to ColourValue
-bool fallbackConversion(orxonox::ColourValue* output, const std::string& input)
-{
-    unsigned int opening_parenthesis, closing_parenthesis = input.find(')');
-    if ((opening_parenthesis = input.find('(')) == std::string::npos) { opening_parenthesis = 0; } else { opening_parenthesis++; }
-
-    SubString tokens(input.substr(opening_parenthesis, closing_parenthesis - opening_parenthesis), ",", SubString::WhiteSpaces, false, '\\', true, '"', true, '\0', '\0', true, '\0');
-    if (tokens.size() >= 4)
-    {
         if (!ConvertValue(&(output->r), tokens[0]))
             return false;
Index: code/branches/core3/src/util/MathConvert.h
===================================================================
--- code/branches/core3/src/util/MathConvert.h	(revision 1778)
+++ code/branches/core3/src/util/MathConvert.h	(revision 1779)
@@ -46,62 +46,82 @@
 
 // Vector2 to std::string
-inline bool explicitConversion(std::string* output, const orxonox::Vector2& input)
+template <>
+struct ConverterExplicit<std::string, orxonox::Vector2>
 {
-    std::ostringstream ostream;
-    if (ostream << input.x << "," << input.y)
+    static bool convert(std::string* output, const orxonox::Vector2& input)
     {
-        (*output) = ostream.str();
-        return true;
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
-    return false;
-}
+};
 
 // Vector3 to std::string
-inline bool explicitConversion(std::string* output, const orxonox::Vector3& input)
+template <>
+struct ConverterExplicit<std::string, orxonox::Vector3>
 {
-    std::ostringstream ostream;
-    if (ostream << input.x << "," << input.y << "," << input.z)
+    static bool convert(std::string* output, const orxonox::Vector3& input)
     {
-        (*output) = ostream.str();
-        return true;
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
-    return false;
-}
+};
 
 // Vector4 to std::string
-inline bool explicitConversion(std::string* output, const orxonox::Vector4& input)
+template <>
+struct ConverterExplicit<std::string, orxonox::Vector4>
 {
-    std::ostringstream ostream;
-    if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
+    static bool convert(std::string* output, const orxonox::Vector4& input)
     {
-        (*output) = ostream.str();
-        return true;
+        std::ostringstream ostream;
+        if (ostream << input.x << "," << input.y << "," << input.z << "," << input.w)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
-    return false;
-}
+};
 
 // Quaternion to std::string
-inline bool explicitConversion(std::string* output, const orxonox::Quaternion& input)
+template <>
+struct ConverterExplicit<std::string, orxonox::Quaternion>
 {
-    std::ostringstream ostream;
-    if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
+    static bool convert(std::string* output, const orxonox::Quaternion& input)
     {
-        (*output) = ostream.str();
-        return true;
+        std::ostringstream ostream;
+        if (ostream << input.w << "," << input.x << "," << input.y << "," << input.z)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
-    return false;
-}
+};
 
 // ColourValue to std::string
-inline bool explicitConversion(std::string* output, const orxonox::ColourValue& input)
+template <>
+struct ConverterExplicit<std::string, orxonox::ColourValue>
 {
-    std::ostringstream ostream;
-    if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
+    static bool convert(std::string* output, const orxonox::ColourValue& input)
     {
-        (*output) = ostream.str();
-        return true;
+        std::ostringstream ostream;
+        if (ostream << input.r << "," << input.g << "," << input.b << "," << input.a)
+        {
+            (*output) = ostream.str();
+            return true;
+        }
+        return false;
     }
-    return false;
-}
+};
 
 
@@ -111,13 +131,18 @@
 
 // std::string to Vector2
-_UtilExport bool fallbackConversion(orxonox::Vector2* output, const std::string& input);
+template <> struct _UtilExport ConverterFallback<orxonox::Vector2,     std::string>
+{ static bool convert(orxonox::Vector2*     output, const std::string& input); };
 // std::string to Vector3
-_UtilExport bool fallbackConversion(orxonox::Vector3* output, const std::string& input);
+template <> struct _UtilExport ConverterFallback<orxonox::Vector3,     std::string>
+{ static bool convert(orxonox::Vector3*     output, const std::string& input); };
 // std::string to Vector4
-_UtilExport bool fallbackConversion(orxonox::Vector4* output, const std::string& input);
+template <> struct _UtilExport ConverterFallback<orxonox::Vector4,     std::string>
+{ static bool convert(orxonox::Vector4*     output, const std::string& input); };
 // std::string to Quaternion
-_UtilExport bool fallbackConversion(orxonox::Quaternion* output, const std::string& input);
+template <> struct _UtilExport ConverterFallback<orxonox::Quaternion,  std::string>
+{ static bool convert(orxonox::Quaternion*  output, const std::string& input); };
 // std::string to ColourValue
-_UtilExport bool fallbackConversion(orxonox::ColourValue* output, const std::string& input);
+template <> struct _UtilExport ConverterFallback<orxonox::ColourValue, std::string>
+{ static bool convert(orxonox::ColourValue* output, const std::string& input); };
 
 
