Commit d07660cc by Paolo Carlini Committed by Paolo Carlini

Makefile.am: Add initializer_list to the headers.

2008-07-03  Paolo Carlini  <paolo.carlini@oracle.com>

	* libsupc++/Makefile.am: Add initializer_list to the headers.
	* libsupc++/Makefile.in: Regenerate.

	* libsupc++/initializer_list: Minor cosmetic changes.

From-SVN: r137409
parent 1466cf1a
2008-07-03 Paolo Carlini <paolo.carlini@oracle.com>
* libsupc++/Makefile.am: Add initializer_list to the headers.
* libsupc++/Makefile.in: Regenerate.
* libsupc++/initializer_list: Minor cosmetic changes.
2008-07-02 Jason Merrill <jason@redhat.com> 2008-07-02 Jason Merrill <jason@redhat.com>
* libsupc++/initializer_list: Uglify and wrap in * libsupc++/initializer_list: Uglify and wrap in
......
## Makefile for the GNU C++ Support library. ## Makefile for the GNU C++ Support library.
## ##
## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 ## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
## Free Software Foundation, Inc. ## Free Software Foundation, Inc.
## ##
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
...@@ -33,7 +33,8 @@ noinst_LTLIBRARIES = libsupc++convenience.la ...@@ -33,7 +33,8 @@ noinst_LTLIBRARIES = libsupc++convenience.la
headers = \ headers = \
exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h \
initializer_list
if GLIBCXX_HOSTED if GLIBCXX_HOSTED
c_sources = \ c_sources = \
......
...@@ -354,7 +354,8 @@ toolexeclib_LTLIBRARIES = libsupc++.la ...@@ -354,7 +354,8 @@ toolexeclib_LTLIBRARIES = libsupc++.la
# 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a # 2) integrated libsupc++convenience.la that is to be a part of libstdc++.a
noinst_LTLIBRARIES = libsupc++convenience.la noinst_LTLIBRARIES = libsupc++convenience.la
headers = \ headers = \
exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h exception new typeinfo cxxabi.h cxxabi-forced.h exception_defines.h \
initializer_list
@GLIBCXX_HOSTED_TRUE@c_sources = \ @GLIBCXX_HOSTED_TRUE@c_sources = \
@GLIBCXX_HOSTED_TRUE@ cp-demangle.c @GLIBCXX_HOSTED_TRUE@ cp-demangle.c
......
...@@ -40,25 +40,30 @@ ...@@ -40,25 +40,30 @@
namespace std namespace std
{ {
template<class _E> template<class _E>
class initializer_list class initializer_list
{ {
const _E* __array; const _E* __array;
size_t __len; size_t __len;
// The compiler can call a private constructor. // The compiler can call a private constructor.
initializer_list(const _E* __a, size_t __l) initializer_list(const _E* __a, size_t __l)
: __array(__a), __len(__l) { } : __array(__a), __len(__l) { }
public: public:
initializer_list() initializer_list()
: __array(NULL), __len(0) {} : __array(NULL), __len(0) { }
size_t size() const // number of elements // Number of elements.
{ return __len; } size_t size() const
const _E* begin() const // first element { return __len; }
{ return __array; }
const _E* end() const // one past the last element // First element.
{ return begin() + size(); } const _E* begin() const
{ return __array; }
// One past the last element.
const _E* end() const
{ return begin() + size(); }
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment