/***************************** PDI STD File ***********************************
This file is third party source, taken from the open source uClibc++ library and
used here with modifications. Thanking to author for providing this .

for the license terms of this file refer the source link below.

referred from   : https://github.com/mike-matera/ArduinoSTL
added Date      : 1st Dec 2024
added by        : Suraj I.
******************************************************************************/


#ifndef __PDISTD_HEADER_INITIALIZER_LIST
#define __PDISTD_HEADER_INITIALIZER_LIST

#pragma GCC visibility push(default)

namespace pdistd{ 

template<class T> 
class initializer_list {
  
private:
  const T* array; 
  size_t len; 

  // Initialize from a { ... } construct
  initializer_list(const T *a, size_t l): array(a), len(l) { }

public:
  
  // default constructor
  initializer_list() : array(NULL), len(0) {}

  size_t size() const {
    return len;
  }

  const T *begin() {
    return array; 
  }

  const T *end() {
    return array + len;
  }

};

}

#endif
