<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" version="2.0">
  <channel>
    <title>C++ Standard</title>
    <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard</link>
    <description>Comment Feed for C++ Standard</description>
    <pubDate>Wed, 09 Sep 2009 19:24:41 GMT</pubDate>
    <generator>Clearspace 1.10.7 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2009-09-09T19:24:41Z</dc:date>
    <item>
      <title>RE:&amp;nbsp;The View (or trip report) from the Mar 2009 C++ Standard meeting</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/05/27/the-view-or-trip-report-from-the-mar-2009-c-standard-meeting#comments-1703</link>
      <description>Thanks Thomas for the question and your interest. I will try to get that up soon and let you know. Do you have an interest in some parts of the talk?</description>
      <pubDate>Wed, 09 Sep 2009 19:24:41 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/05/27/the-view-or-trip-report-from-the-mar-2009-c-standard-meeting#comments-1703</guid>
      <dc:date>2009-09-09T19:24:41Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;The View (or trip report) from the Mar 2009 C++ Standard meeting</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/05/27/the-view-or-trip-report-from-the-mar-2009-c-standard-meeting#comments-1698</link>
      <description>"While I am on BoostCon09, I did a 90 minute talk on the Overview of C++0x and compiler support.&lt;br/&gt;
...&lt;br /&gt;
The video of the talk will be online soon."&lt;br/&gt;
&lt;br/&gt;
Any news ?</description>
      <pubDate>Tue, 08 Sep 2009 06:52:54 GMT</pubDate>
      <author>ThomasPetit</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/05/27/the-view-or-trip-report-from-the-mar-2009-c-standard-meeting#comments-1698</guid>
      <dc:date>2009-09-08T06:52:54Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;Mysteries of Namespaces</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1409</link>
      <description>Nice work!&lt;br /&gt;
&lt;br /&gt;
So from the answer to MOM#2, we can see that a using directive is like using a sledge hammer to your namespace, while a using declaration can be evil in that it depends on the order of includes.&lt;br /&gt;
&lt;br /&gt;
I think I defintely agree that function scope is probably the best way to use it. The same goes for not ever putting either of them in header files. In one case, they bring in all kinds of names. In the other case, we have order dependency problems.&lt;br /&gt;
&lt;br /&gt;
As for the middle two choices, either before or after the include in your CU, I would say definitely never use either of them before the #include. This is agreed by some noted authors. &lt;br /&gt;
&lt;br /&gt;
As for after the include, I can't really think of a reason to discourage their use as long as it makes sense for your use.</description>
      <pubDate>Thu, 19 Feb 2009 07:08:09 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1409</guid>
      <dc:date>2009-02-19T07:08:09Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;Mysteries of Namespaces</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1408</link>
      <description>Yes, that is correct. The using directive effectively makes the names available from the namespace, making them accessible without qualification. It also makes it as if they were declared at global scope, not at the scope of the using directive. So as a result, local names will hide the namespace names.&lt;br/&gt;
The names also remain in force until the end of the function body. &lt;br/&gt;
&lt;br/&gt;
Using declaration is less forceful and provides a middle ground between explicit qualification, and bulldozing your namespace with all the names. A using declaration is an actual declaration, and any local names that are not the same type will lead to a redeclaration error. This is what you observed in the second code snippet.&lt;br /&gt;
&lt;br /&gt;
From this discussion, it is pretty clear that a using-declaration requires that the name it declare must have already been seen.  This makes a using-declaration order dependent when using names from a namespace split across a group of header files. This is potentially bad. The order of header inclusion relative to where the using-declaration appears is important and can change. Of course, the std namespace is one such namespace that is split across multiple headers.&lt;br /&gt;
&lt;br /&gt;
So here is another difference with a using directive. Unlike a using-declaration, a using directive brings in names declared in namespaces both before and after the using directive.  The name's declaration has to be still seen for it to be used, of course. This also makes using-directive powerful, and deadly in a different way then a using-declaration.</description>
      <pubDate>Thu, 19 Feb 2009 06:48:46 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1408</guid>
      <dc:date>2009-02-19T06:48:46Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;Mysteries of Namespaces</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1406</link>
      <description>For mystery #3, I am not aware of any problem puting using declaration/directive in function scope. It is not a good iead to put them in the file scope of a header file though. Adding them in the header file will potentially pollute the declarative scope of any files including the header file. Puting them in header file ahead of include can cause more problem because the names brought in are now visible in all included files, which might cause conflict or change the semantics. It's generally better to use qualified name such as std::vector in header files.</description>
      <pubDate>Wed, 18 Feb 2009 15:36:35 GMT</pubDate>
      <author>JiChao</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1406</guid>
      <dc:date>2009-02-18T15:36:35Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;Mysteries of Namespaces</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1405</link>
      <description>For mystery #2, using declaration introduces the name to the current scope while using directive makes the name visible in the current scope.&lt;br /&gt;
&lt;br /&gt;
So for the first code snippet, the definition of the integer vector hides the definition of vector in std. For the second code snippet, using declaration brings the name vector in to the local scope and the definition of the integer vector causes a conflict.</description>
      <pubDate>Wed, 18 Feb 2009 15:29:12 GMT</pubDate>
      <author>JiChao</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1405</guid>
      <dc:date>2009-02-18T15:29:12Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;Mysteries of Namespaces</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1392</link>
      <description>Yes, you are right. I am guessing there were just too much legacy associated with these to move them into another namespace.</description>
      <pubDate>Tue, 10 Feb 2009 15:51:34 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1392</guid>
      <dc:date>2009-02-10T15:51:34Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;Mysteries of Namespaces</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1391</link>
      <description>For mystery #1, aside from the C standard library macros, the operators new and delete in &amp;lt;new&amp;gt; come to mind.</description>
      <pubDate>Tue, 10 Feb 2009 15:26:28 GMT</pubDate>
      <author>hstong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2009/02/10/mysteries-of-namespaces#comments-1391</guid>
      <dc:date>2009-02-10T15:26:28Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1213</link>
      <description>I think I have to give it to you for the many cases you described. What I was looking for is not that far from what you were describing. It is that now in Mystery #2, we have an imbalance in the number of constructor and destructors, which is always a sign that something bad will happen. May be not immediately, but likely when you add any more complexity to the class (such as more members). &lt;br /&gt;
&lt;br /&gt;
Just counting the construction of X, you will see that there are 2 constructor calls, and only one destructor call. This, as you said, is the worst solution. Well done.</description>
      <pubDate>Fri, 12 Dec 2008 04:23:49 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1213</guid>
      <dc:date>2008-12-12T04:23:49Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1203</link>
      <description>I think that the standard is a bit vague on what constitutes a "reuse" of storage.  This makes it hard for me to tackle the issue with object lifetimes directly.  Anyhow, another case where the placement new solution above will not work is when the object of type X is actually a base class subobject itself.</description>
      <pubDate>Fri, 05 Dec 2008 00:19:24 GMT</pubDate>
      <author>hstong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1203</guid>
      <dc:date>2008-12-05T00:19:24Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1202</link>
      <description>Not bad, and you are definitely dancing around the whole issue of object life times which is where the answer lies.&lt;br/&gt;
&lt;br/&gt;
My response to this is that there is indeed a memory leak, but it need not be from any dynamic memory allocation of subobjects (which I assume you mean embedded members Y and Z).</description>
      <pubDate>Thu, 04 Dec 2008 14:14:23 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1202</guid>
      <dc:date>2008-12-04T14:14:23Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1201</link>
      <description>The subobjects did not have their destructors called.  There can be a memory leak if a subobject allocated memory dynamically.</description>
      <pubDate>Thu, 04 Dec 2008 00:38:39 GMT</pubDate>
      <author>hstong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1201</guid>
      <dc:date>2008-12-04T00:38:39Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1200</link>
      <description>Even if an exception is not thrown, this code has problems ...&lt;br /&gt;
But you are right in that an exception would be even more problematic.</description>
      <pubDate>Wed, 03 Dec 2008 21:38:58 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1200</guid>
      <dc:date>2008-12-03T21:38:58Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1199</link>
      <description>Mystery #2:&lt;br /&gt;
Among other things, destructors for the members of X will be called twice if init() throws an exception.&lt;br /&gt;
This is the worst solution because it has undefined behaviour.</description>
      <pubDate>Wed, 03 Dec 2008 20:49:06 GMT</pubDate>
      <author>hstong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1199</guid>
      <dc:date>2008-12-03T20:49:06Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1198</link>
      <description>Good work!. You are right. The temporary will get created, and destroyed at the end of scope. No delegation.</description>
      <pubDate>Wed, 03 Dec 2008 20:22:30 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1198</guid>
      <dc:date>2008-12-03T20:22:30Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;C++0x delegating constructors</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1197</link>
      <description>Mystery #1:&lt;br /&gt;
In&lt;br /&gt;
&lt;div class="jive-quote"&gt;X( int i ) : y_( i ),z_(1.23) { X(); }&lt;/div&gt;
you are constructing a temporary and not delegating to the default constructor (as intended).</description>
      <pubDate>Wed, 03 Dec 2008 20:09:01 GMT</pubDate>
      <author>hstong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/12/04/c0x-delegating-constructors#comments-1197</guid>
      <dc:date>2008-12-03T20:09:01Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;The Dawn of a new Standard</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/11/18/the-dawn-of-a-new-standard#comments-1190</link>
      <description>Thanks, Bjarne for visiting our blog. IBM, like other compilers, are in the process of implementing many C++0x features. Some of which are already released in xlC V10.1 for AIX and Linux.&lt;br/&gt;
&lt;br/&gt;
&lt;a class="jive-link-external" href="http://www-01.ibm.com/software/awdtools/xlcpp/aix/"&gt;http://www-01.ibm.com/software/awdtools/xlcpp/aix/&lt;/a&gt;&lt;br/&gt;
&lt;a class="jive-link-external" href="http://www-01.ibm.com/software/awdtools/xlcpp/linux/"&gt;http://www-01.ibm.com/software/awdtools/xlcpp/linux/&lt;/a&gt;&lt;br/&gt;
&lt;br/&gt;
In that release, we have implemented C++0x long long and C99 synchronization.The way to access it is to use the option -qlanglvl=extended0x&lt;br/&gt;
&lt;br/&gt;
There is a free trial download as well.&lt;br/&gt;
&lt;br/&gt;
The order of implementation and release will be dictated by many priorities, including not necessarily in any order, customer requests, feature completeness in the standard, dependencies on other features, etc.&lt;br/&gt;
&lt;br/&gt;
Of course, the opinion and specific request of the inventor of C++ will take a certain priority in this overall list &lt;img class="jive-emoticon" border="0" src="http://www-949.ibm.com/software/rational/cafe/images/emoticons/happy.gif" alt=":)"/&gt;&lt;br/&gt;
And if others would like to have input into the order, please discuss here or in the forum.&lt;br/&gt;
&lt;br/&gt;
We wish to thank-you for the leadership you have shown in leading the Evolution Group of the C++ Standard towards C++0x.</description>
      <pubDate>Thu, 20 Nov 2008 17:12:54 GMT</pubDate>
      <author>Michael_Wong</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/11/18/the-dawn-of-a-new-standard#comments-1190</guid>
      <dc:date>2008-11-20T17:12:54Z</dc:date>
    </item>
    <item>
      <title>RE:&amp;nbsp;The Dawn of a new Standard</title>
      <link>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/11/18/the-dawn-of-a-new-standard#comments-1188</link>
      <description>Yes, there are lots of new features. We hope they'll fit together like a set of Lego blocks to support more powerful styles. Let's hope x in C++0x becomes 9.&lt;br /&gt;
&lt;br /&gt;
When will IBM start "dribbling out" C++0x features. I'd like to see "auto" and uniform initialization soon. I guess you'd like to see attributes and user-defined literals &lt;img class="jive-emoticon" border="0" src="http://www-949.ibm.com/software/rational/cafe/images/emoticons/happy.gif" alt=":-)" /&gt;&lt;br /&gt;
&lt;br /&gt;
   --- Bjarne; &lt;a class="jive-link-external" href="http://www.research.att.com/~bs"&gt;http://www.research.att.com/~bs&lt;/a&gt;</description>
      <pubDate>Tue, 18 Nov 2008 20:58:29 GMT</pubDate>
      <author>xxxxxxxxxxx</author>
      <guid>http://www-949.ibm.com/software/rational/cafe/blogs/cpp-standard/2008/11/18/the-dawn-of-a-new-standard#comments-1188</guid>
      <dc:date>2008-11-18T20:58:29Z</dc:date>
    </item>
  </channel>
</rss>

