OCTA_ALLOW_CXXSTD to allow octastd to be used alongside stl (for transition and other projects)

master
Daniel Kolesa 2015-05-27 23:49:59 +01:00
parent 08bb790612
commit 9b98741c4d
2 changed files with 6 additions and 0 deletions

View File

@ -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<typename T>
@ -37,6 +38,9 @@ namespace std {
const T *end() const { return p_buf + p_len; }
};
}
#else
#include <initializer_list>
#endif
namespace octa {
template<typename T> using InitializerList = std::initializer_list<T>;

View File

@ -8,9 +8,11 @@
#include <stddef.h>
#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