ConfigParser using SFINAE to implement get_as<type>()
<p>So in order to get more into metaprogramming I tried to write a config file parser that can return the parsed values as a specific type using a </p>

<pre><code>template&lt;typename T&gt; T get_as(std::string key)
</code></pre>

<p>like interface. Since I'm storing the parsed config file internally as a string-string map, I still need to transform most of the data before I can return it. So I used the type_traits header to transform the data depending on the requested type. I made the following assumptions: </p>

<ul>
<li>All non trivial types must supply a constructor that takes a std::string to construct themself. </li>
<li>Strings are true iff they spell true (impartial to lower/upper/mixedcase), and false iff they spell false, else we raise an exception</li>
</ul>

<p>The implementation is header only and can be found on my <a href="https://github.com/datosh/ConfigReader/blob/master/ConfigReader/ConfigReader.h" rel="nofollow">github page</a>.</p>

<pre><code>/// INTEGRAL TYPES
template&lt;class T, typename std::enable_if&lt;std::is_integral&lt;T&gt;::value &amp;&amp; !std::is_same&lt;bool, T&gt;::value&gt;::type* = nullptr&gt;
T get_as(std::string key)
{
    // Implementation
}

/// FLOATING TYPES
template&lt;class T, typename std::enable_if&lt;std::is_floating_point&lt;T&gt;::value&gt;::type* = nullptr&gt;
T get_as(std::string key)
{
    // Implementation
}

/// BOOL
template&lt;class T, typename std::enable_if&lt;std::is_same&lt;bool, T&gt;::value&gt;::type* = nullptr&gt;
T get_as(std::string key)
{
    // Implementation
}

/// COMPLEX TYPE
template&lt;class T, typename std::enable_if&lt;std::is_class&lt;T&gt;::value&gt;::type* = nullptr&gt;
T get_as(std::string key)
{
    // Implementation
}
</code></pre>

<p>The questions I have is whether this is an okay design to split my executing like this depending on the requested type. Or is there a better way to implement a type dependent get_as interface? </p>