This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add <initializer_list> to stdc++.h and ruminations on aggregation headers


All,

I was looking at Bjarne Stroustrups proposal n2905.pdf for aggregation headers and looking at our own in precomp.

His std-all is basically our stdc++.h except that the latter doesn't have <initializer_list>. I know it really is in there but I thought it might be nice to put it in there explicitly for forms sake. See the patch and changelog.

Also attached are simple implementations of std-all and std-checked to play with and some toy drivers.

In particular, is there anything we could add to std-checked that libstdc++ checks?
Maybe if someone, say, includes <vector> and then includes <std-checked> we should yell because (unless they threw the debug flag on the command line) they won't get the range checking.


We could add an ext-all.

Naturally, these would be candidates for user pch.

Of course these aggregation headers are not in the std yet ;-). These are just to think about.

But the patchlet adding <initializer_list> to stdc++.h is bootstrapped and regtested on powerpc-apple-darwin7.9.0.

Ed

// ./bin/bin/g++ -std=c++0x -o std_checked std_checked.cpp

// LD_LIBRARY_PATH=bin/lib64 ./std_checked

#include "std-checked"

int
main( void )
{
    std::vector<int> v(5);
    std::cout << "v[5] = " << v[5] << std::endl;
    return 0;
}

// ./bin/bin/g++ -std=c++0x -o std_all std_all.cpp

#include "std-all"

int
main( void )
{
    std::vector<int> v(5);
    std::cout << "v[5] = " << v[5] << std::endl;
    return 0;
}

Attachment: std-checked
Description: video/flv

Attachment: std-all
Description: video/flv

Attachment: CL_stdc++
Description: video/flv

Index: include/precompiled/stdc++.h
===================================================================
--- include/precompiled/stdc++.h	(revision 151652)
+++ include/precompiled/stdc++.h	(working copy)
@@ -101,6 +101,7 @@
 #include <condition_variable>
 #include <forward_list>
 #include <future>
+#include <initializer_list>
 #include <mutex>
 #include <random>
 #include <ratio>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]