<p>In <a href="https://github.com/mlpack/mlpack/pull/686#discussion_r66366961">src/mlpack/methods/ne/gene.hpp</a>:</p>
<pre style='color:#555'>> +
> + // Destructor.
> + ~LinkGene() {}
> +
> + // Get aFromNeuronId.
> + unsigned int FromNeuronId() const { return aFromNeuronId; }
> +
> + // Get aToNeuronId.
> + unsigned int ToNeuronId() const { return aToNeuronId; }
> +
> + // Get aInnovationId.
> + unsigned int InnovationId() const { return aInnovationId; }
> +
> + // Set aWeight.
> + void Weight(double weight) { aWeight = weight; }
> +
</pre>
<p><a href="https://github.com/zoq" class="user-mention">@zoq</a> So in this way, linkGene.Weight() get the weight, and linkGene.Weight() = weight set the member weight, is this correct?</p>
<p>I can change them into this style. But just a little bit curious, what is the main benefit of this format? (compared with Weight() getter and Weight(weight) setter)</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/mlpack/mlpack/pull/686/files/3c8aa62b951f029b3883e9baef1ea556ef5af2d3#r66366961">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe/AJ4bFI8XmANWzsDUZaZ9j6JbO3gb4nNGks5qJ2LMgaJpZM4IwJa6">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AJ4bFDtnvuP_0vs6rGeItm5tHdXmPHTdks5qJ2LMgaJpZM4IwJa6.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/mlpack/mlpack/pull/686/files/3c8aa62b951f029b3883e9baef1ea556ef5af2d3#r66366961"></link>
<meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>