Skip to content

Commit

Permalink
ghostl array compatibility: aggregate initialization, no implicit cas…
Browse files Browse the repository at this point in the history
…t to T*.
  • Loading branch information
dok-net committed Oct 2, 2019
1 parent 2da9a83 commit 67836ae
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "EspSoftwareSerial",
"version": "5.3.2",
"version": "5.3.3",
"keywords": [
"serial", "io", "softwareserial"
],
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EspSoftwareSerial
version=5.3.2
version=5.3.3
author=Peter Lerup, Dirk Kaar
maintainer=Peter Lerup <peter@lerup.com>
sentence=Implementation of the Arduino software serial for ESP8266/ESP32.
Expand Down
14 changes: 5 additions & 9 deletions src/circular_queue/ghostl.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,14 @@ namespace std
template< typename T > T&& move(T& t) noexcept { return static_cast<T&&>(t); }
#endif

template< typename T, int N > class array
template< typename T, unsigned long N > struct array
{
private:
T v[N]{};
public:
int size() const { return N; }
T& operator[](int i) { return v[i]; }
const T& operator[](int i) const { return v[i]; }
operator T* () { return v; }
T _M_elems[N];
unsigned long size() const { return N; }
T& operator[](unsigned long i) { return _M_elems[i]; }
const T& operator[](unsigned long i) const { return _M_elems[i]; }
};


template< typename T > class unique_ptr
{
public:
Expand Down

0 comments on commit 67836ae

Please sign in to comment.