Create a new struct inside a while loop when condition changes
<p>I'm developing a C++ static library with Visual Studio 2015.</p>

<p>I have the following struct:</p>

<pre><code>struct ConstellationArea
{
    // Constellation's abbrevation.
    std::string abbrevation;
    // Area's vertices.
    std::vector&lt;std::string&gt; coordinate;

    ConstellationArea(std::string cons) : abbrevation(cons)
    {}
};
</code></pre>

<p>I use it in a while (note that the method is not ended):</p>

<pre><code>vector&lt;ConstellationArea&gt;ConstellationsArea::LoadFile(string filePath)
{
    ifstream constellationsFile;
    vector&lt;ConstellationArea&gt; areas;

    string line;
    ConstellationArea area("");
    string currentConstellation;

    // Check if path is null or empty.
    if (!IsNullOrWhiteSpace(filePath))
    {
        constellationsFile.open(filePath.c_str(), fstream::in);

        // Check if I can open it...
        if (constellationsFile.good())
        {
            // Read file line by line.
            while (getline(constellationsFile, line))
            {
                vector&lt;string&gt; tokens = split(line, '|');

                if ((currentConstellation.empty()) ||
                    (currentConstellation != tokens[0]))
                {
                    currentConstellation = tokens[0];

                    areas.push_back(area);

                    area(tokens[0]);
                }
            }
        }
    }

    return areas;
}
</code></pre>

<p>I want to create a new <code>area</code> object when <code>tokens[0]</code> changes but I don't know how to do it.</p>

<p>This statement <code>area(tokens[0]);</code> throws the following error:</p>

<blockquote>
  <p>call an object of a class type without any conversion function or
  operator () suitable for the type of function pointer</p>
</blockquote>

<p>How can I create a new struct when I need it?</p>

<p>I'm a C# developer and I can't figure out how to do it in C++.</p>