<div dir="ltr">Hi Ben, <div><br></div><div>I looked at it earlier. Although its kind of good its not perfect (none of the others too). The problem is that </div><div><br></div><div style>1. You should be checking if the call to constructor is coming from a derived class indeed</div>
<div style><br></div><div style>2. The API gets clunky (the constructor I guess). Although its not bad. </div><div style><br></div><div style>Although I was thinking of something similar but instead in the constructor we have this dedicated method that you need to call and there we check if its coming from one of its own, </div>
<div style>and attach its protected member variables. This method can be called right after we instantiate the base class members.</div><div style><br></div><div style><br></div><div style>- Aashish</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Sep 11, 2013 at 10:42 AM, Ben Burnett <span dir="ltr"><<a href="mailto:benjam.arlyn@gmail.com" target="_blank">benjam.arlyn@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Has anyone looked at this solution?<div><br></div><div><a href="http://stackoverflow.com/a/8703764" target="_blank">http://stackoverflow.com/a/8703764</a><br></div><div><br></div><div>One flaw is that users who instantiate the base class directly could get access to these protected values if they knew what they were doing, but otherwise it seems good, and doesn't add any members that are directly visible on the objects.</div>
</div>
<br>_______________________________________________<br>
Opengeoscience-developers mailing list<br>
<a href="mailto:Opengeoscience-developers@public.kitware.com">Opengeoscience-developers@public.kitware.com</a><br>
<a href="http://public.kitware.com/cgi-bin/mailman/listinfo/opengeoscience-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/opengeoscience-developers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>| Aashish Chaudhary <br>| R&D Engineer <br>| Kitware Inc. <br>| <a href="http://www.kitware.com">www.kitware.com</a>
</div>