Converting values inside constructor initialization list c++
<p>Say I have a constructor that takes in a string type vector.
If one of the class member is not a string but instead a double, how would I go about converting the string vector element to double inside the constructor? </p>

<pre><code>Foo::Foo(const std::vector&lt;string&gt;&amp; v):
d(v[0].toDouble()){}
</code></pre>

<p>I am aware that toDouble() doesn't work in c++ I'm just putting it here as an example of what I want to do.</p>

<p>Thanks.</p>