Merge pull request #625 from barfowl/stack_buffer

Resolve MSVC 32-bit build error with StackBuffer
This commit is contained in:
David G Yu 2015-06-10 18:42:35 -07:00
commit a21cd1560b

View File

@ -59,8 +59,10 @@ public:
~StackBuffer();
public:
TYPE & operator[](size_type index) { return _data[index]; }
TYPE const & operator[](size_type index) const { return _data[index]; }
// Note the reliance on implicit casting so that it can be used similar to
// a VLA. This removes the need for operator[] as the resulting TYPE* will
// natively support []. (The presence of both TYPE* and operator[] also
// causes an ambiguous overloading error with 32-bit MSVC builds.)
operator TYPE const * () const { return _data; }
operator TYPE * () { return _data; }