initializer_list
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _INITIALIZER_LIST
00031 #define _INITIALIZER_LIST
00032
00033 #ifdef __GXX_EXPERIMENTAL_CXX0X__
00034
00035 #pragma GCC visibility push(default)
00036
00037 #include <cstddef>
00038
00039 namespace std
00040 {
00041
00042 template<class _E>
00043 class initializer_list
00044 {
00045 public:
00046 typedef _E value_type;
00047 typedef const _E& reference;
00048 typedef const _E& const_reference;
00049 typedef size_t size_type;
00050 typedef const _E* iterator;
00051 typedef const _E* const_iterator;
00052
00053 private:
00054 iterator _M_array;
00055 size_type _M_len;
00056
00057
00058 initializer_list(const_iterator __a, size_type __l)
00059 : _M_array(__a), _M_len(__l) { }
00060
00061 public:
00062 initializer_list() : _M_array(NULL), _M_len(0) { }
00063
00064
00065 size_type
00066 size() const { return _M_len; }
00067
00068
00069 const_iterator
00070 begin() const { return _M_array; }
00071
00072
00073 const_iterator
00074 end() const { return begin() + size(); }
00075 };
00076 }
00077
00078 #pragma GCC visibility pop
00079 #endif // C++0x
00080 #endif // _INITIALIZER_LIST