// initializer_list standard header -*-c++-*-
// Copyright 2009-2017 IAR Systems AB.
#ifndef _INITIALIZER_LIST_
#define _INITIALIZER_LIST_

#ifndef _SYSTEM_BUILD
#pragma system_include
#endif

#include <cstddef>

namespace std {

// 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;

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

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

  constexpr initializer_list(const _Elem *_First_arg, size_t _Count)
    : _First(_First_arg), _Last(_First_arg + _Count)
  {       // construct with pointers
  }

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

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

  constexpr size_t size() const _NOEXCEPT
  {       // get length of list
    return (size_t)(_Last - _First);
  }

private:
  const _Elem *_First;
  const _Elem *_Last;
};

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

// TEMPLATE FUNCTION end
template<class _Elem> inline
constexpr const _Elem *end(::std::initializer_list<_Elem> _Ilist) _NOEXCEPT
{       // get end of sequence
  return _Ilist.end();
}

} /* namespace std */

#endif /* _INITIALIZER_LIST_ */

/*
 * Copyright (c) by P.J. Plauger. All rights reserved.
 * Consult your license regarding permissions and restrictions.
V6.50:0576 */
