forked from OctaForge/libostd
OCTA_ALLOW_CXXSTD to allow octastd to be used alongside stl (for transition and other projects)
parent
08bb790612
commit
9b98741c4d
|
@ -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>;
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue