/***************************** PDI STD File ***********************************
This file is taken from external sources. this is taken from open source uClibc++ 
library available on github. below is reference link. Thanking to author for
providing this .

This is free software. you can redistribute it and/or modify it but without any
warranty.

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
