From 9b98741c4d6a5f5fea937267bb80aefca327a66d Mon Sep 17 00:00:00 2001 From: q66 Date: Wed, 27 May 2015 23:49:59 +0100 Subject: [PATCH] OCTA_ALLOW_CXXSTD to allow octastd to be used alongside stl (for transition and other projects) --- octa/initializer_list.h | 4 ++++ octa/new.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/octa/initializer_list.h b/octa/initializer_list.h index 61ac3b9..5a96ad5 100644 --- a/octa/initializer_list.h +++ b/octa/initializer_list.h @@ -10,6 +10,7 @@ #include "octa/range.h" +#ifndef OCTA_ALLOW_CXXSTD /* must be in std namespace otherwise the compiler won't know about it */ namespace std { template @@ -37,6 +38,9 @@ namespace std { const T *end() const { return p_buf + p_len; } }; } +#else +#include +#endif namespace octa { template using InitializerList = std::initializer_list; diff --git a/octa/new.h b/octa/new.h index a2b6401..3919f55 100644 --- a/octa/new.h +++ b/octa/new.h @@ -8,9 +8,11 @@ #include +#ifndef OCTA_ALLOW_CXXSTD inline void *operator new (size_t, void *p) { return p; } inline void *operator new [](size_t, void *p) { return p; } inline void operator delete (void *, void *) {} inline void operator delete[](void *, void *) {} +#endif #endif \ No newline at end of file