Why is the return type of the function not consistent with the actual sentence? : <p>In the program, it has:</p>

<pre><code>EnergyFunctional* ef;
ef-&gt;insertFrame(fh, &amp;Hcalib);
</code></pre>

<p>The function is defined as follows:</p>

<pre><code>EFFrame* EnergyFunctional::insertFrame(FrameHessian* fh, CalibHessian* Hcalib)
{
    EFFrame* eff = new EFFrame(fh);
    eff-&gt;idx = frames.size();
    frames.push_back(eff);

    nFrames++;
    fh-&gt;efFrame = eff;

    assert(HM.cols() == 8*nFrames+CPARS-8); ///  CPARS = 4
    bM.conservativeResize(8*nFrames+CPARS);
    HM.conservativeResize(8*nFrames+CPARS,8*nFrames+CPARS);
    bM.tail&lt;8&gt;().setZero();
    HM.rightCols&lt;8&gt;().setZero();
    HM.bottomRows&lt;8&gt;().setZero();

    EFIndicesValid = false;
    EFAdjointsValid=false;
    EFDeltaValid=false;

    setAdjointsF(Hcalib);
    makeIDX();


    for(EFFrame* fh2 : frames)
    {
        connectivityMap[(((uint64_t)eff-&gt;frameID) &lt;&lt; 32) + ((uint64_t)fh2-&gt;frameID)] = Eigen::Vector2i(0,0); /// move left 32 bits
        if(fh2 != eff)
            connectivityMap[(((uint64_t)fh2-&gt;frameID) &lt;&lt; 32) + ((uint64_t)eff-&gt;frameID)] = Eigen::Vector2i(0,0);  /// index is totally 64 bits, front 32 bits for each frame, rear 32 bits for current frame
    }

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

<p>It seems like the return type should be void so that it can be consistent with last sentence...</p>

<p>I also checked if there is other same name "inserFrame" functions, but there is not. </p>

<p>This program can be compiled successfully, but why can it be no problem?</p>
