镇楼图
- 目录
- 1.核心源码剖析
- 2.使用介绍
- 3.完整源码
核心源码剖析
来看看源码:
template<class _E>
class initializer_list
{
public:
typedef _E value_type;
typedef const _E& reference;
typedef const _E& const_reference;
typedef size_t size_type;
typedef const _E* iterator;
typedef const _E* const_iterator;
private:
iterator _M_array;
size_type _M_len;
// The compiler can call a private constructor.
constexpr initializer_list(const_iterator __a, size_type __l)
: _M_array(__a), _M_len(__l) {
}
public:
constexpr initializer_list() noexcept
: _M_array(0), _M_len(0) {
}
// Number of elements.
constexpr size_type
size() const noexcept {
return _M_len; }
// First element.
constexpr const_iterator
begin() const noexcept {
return _M_array; }
// One past the last element.
constexpr const_iterator
end() const noexcept {
return begin(