<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>C++ implementations (virtual methods in constructor OK?) - C++ - tribe.net</title>
  <link rel="alternate" href="http://cpp.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab?format=atom" />
  <subtitle>Tribe.net. Local Connections</subtitle>
  <entry>
    <title>C++ implementations (virtual methods in constructor OK?)</title>
    <link rel="alternate" href="http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#ae996112-cc1f-46b5-8c4c-39285eeba3df" />
    <author>
      <name>Genghis "Doh!"</name>
    </author>
    <id>http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#ae996112-cc1f-46b5-8c4c-39285eeba3df</id>
    <published>2004-03-15T17:34:09Z</published>
    <summary type="html">A couple years ago, a friend of mine who's a fellow C++ geek mentioned that virtual methods should not be invoked from a constructor because it's unknown whether a given C++ implementation initializes a class's virtual table before or after its constructor is invoked.&#xD;
&#xD;
This isn't an issue with the C++ version I've worked with (Microsoft's Visual Studio C++) but I'm wondering whether anyone here has run into an implementation where it IS an issue.  I haven't checked g++ yet...&#xD;
&#xD;
Best, Don</summary>
    <dc:creator>Genghis "Doh!"</dc:creator>
    <dc:date>2004-03-15T17:34:09Z</dc:date>
  </entry>
  <entry>
    <title>Re: C++ implementations (virtual methods in constructor OK?)</title>
    <link rel="alternate" href="http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#718641ca-05a3-41e9-9a73-31da90ba151e" />
    <author>
      <name>Bartosz</name>
    </author>
    <id>http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#718641ca-05a3-41e9-9a73-31da90ba151e</id>
    <published>2004-03-15T22:29:31Z</published>
    <summary type="html">Your geek friend was right. Never call virtual functions from a constructor or a destructor. During construction and destruction the vtables are switched (they must be, if you think about it). It's part of the C++ Standard.</summary>
    <dc:creator>Bartosz</dc:creator>
    <dc:date>2004-03-15T22:29:31Z</dc:date>
  </entry>
  <entry>
    <title>Re: C++ implementations (virtual methods in constructor OK?)</title>
    <link rel="alternate" href="http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#dc7b4020-ecfb-41d2-8844-066682f6217b" />
    <author>
      <name>Genghis "Doh!"</name>
    </author>
    <id>http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#dc7b4020-ecfb-41d2-8844-066682f6217b</id>
    <published>2004-03-18T21:18:44Z</published>
    <summary type="html">Suggest a good book that would help me master C++ with this level of knowledge?</summary>
    <dc:creator>Genghis "Doh!"</dc:creator>
    <dc:date>2004-03-18T21:18:44Z</dc:date>
  </entry>
  <entry>
    <title>Re: C++ implementations (virtual methods in constructor OK?)</title>
    <link rel="alternate" href="http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#4fe07c21-241b-41f4-b39b-2970a6eb4b23" />
    <author>
      <name>Bartosz</name>
    </author>
    <id>http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#4fe07c21-241b-41f4-b39b-2970a6eb4b23</id>
    <published>2004-03-23T23:37:40Z</published>
    <summary type="html">Have a look at my book "C++ In Action" online at http://www.relisoft.com/book . If you like it, you can buy one used for less than $10 (there's a link there).</summary>
    <dc:creator>Bartosz</dc:creator>
    <dc:date>2004-03-23T23:37:40Z</dc:date>
  </entry>
  <entry>
    <title>Re: C++ implementations (virtual methods in constructor OK?)</title>
    <link rel="alternate" href="http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#8dc41a64-9c35-44fe-8c07-f7412fb23abd" />
    <author>
      <name>Genghis "Doh!"</name>
    </author>
    <id>http://CPP.tribe.net/thread/301c4b47-8eb1-48c7-b265-e77bccb108ab#8dc41a64-9c35-44fe-8c07-f7412fb23abd</id>
    <published>2004-03-23T23:40:47Z</published>
    <summary type="html">VERY cool!  Thanks for the tip!</summary>
    <dc:creator>Genghis "Doh!"</dc:creator>
    <dc:date>2004-03-23T23:40:47Z</dc:date>
  </entry>
</feed>



