Skip to content

Commit

Permalink
libcore|ByteRefArray: Template for casting the array pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Nov 10, 2015
1 parent 8198d9f commit 92915fc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doomsday/sdk/libcore/include/de/data/byterefarray.h
Expand Up @@ -14,7 +14,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#ifndef LIBDENG2_BYTEREFARRAY_H
Expand Down Expand Up @@ -70,6 +70,9 @@ class DENG2_PUBLIC ByteRefArray : public IByteArray
*/
void *base();

template <typename Type>
Type const *baseAs() const { return reinterpret_cast<Type const *>(base()); }

/**
* Returns a non-modifiable pointer to the start of the array.
*/
Expand Down

0 comments on commit 92915fc

Please sign in to comment.