From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from qmta09.westchester.pa.mail.comcast.net (qmta09.westchester.pa.mail.comcast.net [IPv6:2001:558:fe14:43:76:96:62:96]) by hurricane.the-brannons.com (Postfix) with ESMTP id 8F6C977F80 for ; Wed, 12 Feb 2014 07:05:46 -0800 (PST) Received: from omta07.westchester.pa.mail.comcast.net ([76.96.62.59]) by qmta09.westchester.pa.mail.comcast.net with comcast id RQnR1n0031GhbT859T54ga; Wed, 12 Feb 2014 15:05:04 +0000 Received: from eklhad ([107.5.36.150]) by omta07.westchester.pa.mail.comcast.net with comcast id RT541n00M3EMmQj3TT54m3; Wed, 12 Feb 2014 15:05:04 +0000 To: Edbrowse-dev@lists.the-brannons.com From: Karl Dahlke User-Agent: edbrowse/3.5.1 Date: Wed, 12 Feb 2014 10:05:04 -0500 Message-ID: <20140112100504.eklhad@comcast.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1392217504; bh=df+uxDYmPqRH/+6elgFA1zEcv916WLMSXIf3yfNlqkc=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=SNeaDoLq3pZHvXarQaKieB8+8SR2jtoNhFgBjxsCBYY9ZY8FcZF/qy9CNVBEPdL2e +58IMWaZrvn4h1nzRIBf+ywAsCeKejxg97pugkuD2iptJ/4Bv/fkPPf8EsiLnMrYnc FOyhk7Ik93cxXrlGgStjSNQ/CqLKhcpNBQoh9HvcI8KexflIKXeC+y7Z+aLRGGxXmO 08H0Q0oswD1AmY6PhGtT4GEr4T4oWRH4kvYeHsVkmQ8HqnALR4/d2S5IiTtE7BrgIE 0Id656SUJBm4CY34mNAfZODeGMcVwPCLnIuG3nsWaoaVAxHMme2zeLFYEyaSq/79ty HrsyKadzXc6sQ== Subject: [Edbrowse-dev] scope test X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list Reply-To: Karl Dahlke List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Feb 2014 15:05:46 -0000 Still exploring C++, I wanted to make sure the Compartment macro didn't fire its constructor if you didn't reach it in execution, even though it is at the highest scope of the function, and I was pretty sure it wouldn't, but here is a little program to prove. Think of foo as our AutoCompartment. It constructs, unless you type in a q. #include using namespace std; class foo { public: foo(void) { cout << "hello\n"; } ~foo(void) { cout << "goodbye\n"; } }; int main() { string s; getline(cin, s); if(s[0] == 'q') return 0; foo f; } Karl Dahlke