// initializer_list standard header
#ifndef _INITIALIZER_LIST_
#define _INITIALIZER_LIST_

#if __cplusplus < 201103L
#error This file requires compiler and library support for the \
ISO C++ 2011 standard. This support is currently experimental, and must be \
enabled with the -std=c++11 or -std=gnu++11 compiler options.
#endif

#include <cstddef>

_X_STD_BEGIN
		// TEMPLATE CLASS initializer_list
template<class _Elem>
	class initializer_list
	{	// list of pointers to elements
public:
	typedef _Elem value_type;
	typedef const _Elem& reference;
	typedef const _Elem& const_reference;
	typedef size_t size_type;

	typedef const _Elem* iterator;
	typedef const _Elem* const_iterator;

#if defined(__XC32)
	constexpr initializer_list() noexcept
		: _M_array(0), _M_len(0) 
		{ 
		}

	constexpr initializer_list(const_iterator __a, size_type __l)
		: _M_array(__a), _M_len(__l) 
		{
		}

	constexpr const_iterator
		begin() const noexcept 
		{	// get beginning of list
		return _M_array;
		}

	constexpr const_iterator end() const noexcept
		{	// get end of list=
		return begin() + size();
		}

	constexpr size_type size() const noexcept
		{	// get length of list
		return 
		_M_len;
		}

#else

	initializer_list()
		: _First(0), _Last(0)
		{	// empty list
		}

	initializer_list(const _Elem *_First_arg, const _Elem *_Last_arg)
		: _First(_First_arg), _Last(_Last_arg)
		{	// construct with pointers
		}

	const _Elem *begin() const
		{	// get beginning of list
		return (_First);
		}

	const _Elem *end() const
		{	// get end of list
		return (_Last);
		}

	size_t size() const
		{	// get length of list
		return ((size_t)(_Last - _First));
		}
#endif /* __XC32 */

private:
#if defined(__XC32)
	iterator  _M_array;
	size_type _M_len;
#else
	const _Elem *_First;
	const _Elem *_Last;
#endif
	};

		// TEMPLATE FUNCTION begin
template<class _Elem> inline
	const _Elem *begin(initializer_list<_Elem> _Ilist)
	{	// get beginning of sequence
	return (_Ilist.begin());
	}

		// TEMPLATE FUNCTION end
template<class _Elem> inline
	const _Elem *end(initializer_list<_Elem> _Ilist)
	{	// get end of sequence
	return (_Ilist.end());
	}
_X_STD_END
#endif /* _INITIALIZER_LIST_ */

/*
 * Copyright (c) 1992-2010 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
V5.30:0009 */
