mv the octa directory too

master
Daniel Kolesa 2015-07-13 20:08:55 +01:00
parent 8ddbccc94f
commit 1c4f04757d
27 changed files with 236 additions and 236 deletions

View File

@ -3,15 +3,15 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_ALGORITHM_HH
#define OCTA_ALGORITHM_HH
#ifndef OSTD_ALGORITHM_HH
#define OSTD_ALGORITHM_HH
#include <math.h>
#include "octa/functional.hh"
#include "octa/range.hh"
#include "octa/utility.hh"
#include "octa/initializer_list.hh"
#include "ostd/functional.hh"
#include "ostd/range.hh"
#include "ostd/utility.hh"
#include "ostd/initializer_list.hh"
namespace ostd {

View File

@ -3,15 +3,15 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_ARRAY_HH
#define OCTA_ARRAY_HH
#ifndef OSTD_ARRAY_HH
#define OSTD_ARRAY_HH
#include <stddef.h>
#include "octa/algorithm.hh"
#include "octa/range.hh"
#include "octa/string.hh"
#include "octa/internal/tuple.hh"
#include "ostd/algorithm.hh"
#include "ostd/range.hh"
#include "ostd/string.hh"
#include "ostd/internal/tuple.hh"
namespace ostd {

View File

@ -3,14 +3,14 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_ATOMIC_HH
#define OCTA_ATOMIC_HH
#ifndef OSTD_ATOMIC_HH
#define OSTD_ATOMIC_HH
#include <stdint.h>
#include <stddef.h>
#include "octa/types.hh"
#include "octa/type_traits.hh"
#include "ostd/types.hh"
#include "ostd/type_traits.hh"
namespace ostd {

View File

@ -3,18 +3,18 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_FORMAT_HH
#define OCTA_FORMAT_HH
#ifndef OSTD_FORMAT_HH
#define OSTD_FORMAT_HH
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <assert.h>
#include "octa/algorithm.hh"
#include "octa/string.hh"
#include "octa/utility.hh"
#include "octa/internal/tuple.hh"
#include "ostd/algorithm.hh"
#include "ostd/string.hh"
#include "ostd/utility.hh"
#include "ostd/internal/tuple.hh"
namespace ostd {

View File

@ -3,22 +3,22 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_FUNCTIONAL_HH
#define OCTA_FUNCTIONAL_HH
#ifndef OSTD_FUNCTIONAL_HH
#define OSTD_FUNCTIONAL_HH
#include <string.h>
#include "octa/platform.hh"
#include "octa/new.hh"
#include "octa/memory.hh"
#include "octa/utility.hh"
#include "octa/type_traits.hh"
#include "ostd/platform.hh"
#include "ostd/new.hh"
#include "ostd/memory.hh"
#include "ostd/utility.hh"
#include "ostd/type_traits.hh"
namespace ostd {
/* basic function objects */
#define OCTA_DEFINE_BINARY_OP(name, op, RT) \
#define OSTD_DEFINE_BINARY_OP(name, op, RT) \
template<typename T> struct name { \
RT operator()(const T &x, const T &y) const { \
return x op y; \
@ -28,24 +28,24 @@ template<typename T> struct name { \
using Result = RT; \
};
OCTA_DEFINE_BINARY_OP(Less, <, bool)
OCTA_DEFINE_BINARY_OP(LessEqual, <=, bool)
OCTA_DEFINE_BINARY_OP(Greater, >, bool)
OCTA_DEFINE_BINARY_OP(GreaterEqual, >=, bool)
OCTA_DEFINE_BINARY_OP(Equal, ==, bool)
OCTA_DEFINE_BINARY_OP(NotEqual, !=, bool)
OCTA_DEFINE_BINARY_OP(LogicalAnd, &&, bool)
OCTA_DEFINE_BINARY_OP(LogicalOr, ||, bool)
OCTA_DEFINE_BINARY_OP(Modulo, %, T)
OCTA_DEFINE_BINARY_OP(Multiply, *, T)
OCTA_DEFINE_BINARY_OP(Divide, /, T)
OCTA_DEFINE_BINARY_OP(Add, +, T)
OCTA_DEFINE_BINARY_OP(Subtract, -, T)
OCTA_DEFINE_BINARY_OP(BitAnd, &, T)
OCTA_DEFINE_BINARY_OP(BitOr, |, T)
OCTA_DEFINE_BINARY_OP(BitXor, ^, T)
OSTD_DEFINE_BINARY_OP(Less, <, bool)
OSTD_DEFINE_BINARY_OP(LessEqual, <=, bool)
OSTD_DEFINE_BINARY_OP(Greater, >, bool)
OSTD_DEFINE_BINARY_OP(GreaterEqual, >=, bool)
OSTD_DEFINE_BINARY_OP(Equal, ==, bool)
OSTD_DEFINE_BINARY_OP(NotEqual, !=, bool)
OSTD_DEFINE_BINARY_OP(LogicalAnd, &&, bool)
OSTD_DEFINE_BINARY_OP(LogicalOr, ||, bool)
OSTD_DEFINE_BINARY_OP(Modulo, %, T)
OSTD_DEFINE_BINARY_OP(Multiply, *, T)
OSTD_DEFINE_BINARY_OP(Divide, /, T)
OSTD_DEFINE_BINARY_OP(Add, +, T)
OSTD_DEFINE_BINARY_OP(Subtract, -, T)
OSTD_DEFINE_BINARY_OP(BitAnd, &, T)
OSTD_DEFINE_BINARY_OP(BitOr, |, T)
OSTD_DEFINE_BINARY_OP(BitXor, ^, T)
#undef OCTA_DEFINE_BINARY_OP
#undef OSTD_DEFINE_BINARY_OP
template<typename T> struct LogicalNot {
bool operator()(const T &x) const { return !x; }
@ -164,7 +164,7 @@ namespace detail {
};
}
#if OCTA_BYTE_ORDER == OCTA_ENDIAN_LIL
#if OSTD_BYTE_ORDER == OSTD_ENDIAN_LIL
template<typename T> struct FromLilEndian: detail::EndianSame<T> {};
template<typename T> struct FromBigEndian: EndianSwap<T> {};
#else
@ -197,25 +197,25 @@ namespace detail {
};
}
#define OCTA_HASH_BASIC(T) template<> struct ToHash<T>: detail::ToHashBase<T> {};
#define OSTD_HASH_BASIC(T) template<> struct ToHash<T>: detail::ToHashBase<T> {};
OCTA_HASH_BASIC(bool)
OCTA_HASH_BASIC(char)
OCTA_HASH_BASIC(short)
OCTA_HASH_BASIC(int)
OCTA_HASH_BASIC(long)
OSTD_HASH_BASIC(bool)
OSTD_HASH_BASIC(char)
OSTD_HASH_BASIC(short)
OSTD_HASH_BASIC(int)
OSTD_HASH_BASIC(long)
OCTA_HASH_BASIC(sbyte)
OCTA_HASH_BASIC(byte)
OCTA_HASH_BASIC(ushort)
OCTA_HASH_BASIC(uint)
OCTA_HASH_BASIC(ulong)
OSTD_HASH_BASIC(sbyte)
OSTD_HASH_BASIC(byte)
OSTD_HASH_BASIC(ushort)
OSTD_HASH_BASIC(uint)
OSTD_HASH_BASIC(ulong)
OCTA_HASH_BASIC(Char16)
OCTA_HASH_BASIC(Char32)
OCTA_HASH_BASIC(Wchar)
OSTD_HASH_BASIC(Char16)
OSTD_HASH_BASIC(Char32)
OSTD_HASH_BASIC(Wchar)
#undef OCTA_HASH_BASIC
#undef OSTD_HASH_BASIC
namespace detail {
inline Size mem_hash(const void *p, Size l) {

View File

@ -3,14 +3,14 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_INITIALIZER_LIST_HH
#define OCTA_INITIALIZER_LIST_HH
#ifndef OSTD_INITIALIZER_LIST_HH
#define OSTD_INITIALIZER_LIST_HH
#include <stddef.h>
#include "octa/range.hh"
#include "ostd/range.hh"
#ifndef OCTA_ALLOW_CXXSTD
#ifndef OSTD_ALLOW_CXXSTD
/* must be in std namespace otherwise the compiler won't know about it */
namespace std {

View File

@ -3,16 +3,16 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_INTERNAL_HASHTABLE_HH
#define OCTA_INTERNAL_HASHTABLE_HH
#ifndef OSTD_INTERNAL_HASHTABLE_HH
#define OSTD_INTERNAL_HASHTABLE_HH
#include <string.h>
#include "octa/types.hh"
#include "octa/utility.hh"
#include "octa/memory.hh"
#include "octa/range.hh"
#include "octa/initializer_list.hh"
#include "ostd/types.hh"
#include "ostd/utility.hh"
#include "ostd/memory.hh"
#include "ostd/range.hh"
#include "ostd/initializer_list.hh"
namespace ostd {

View File

@ -4,11 +4,11 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_INTERNAL_TUPLE_HH
#define OCTA_INTERNAL_TUPLE_HH
#ifndef OSTD_INTERNAL_TUPLE_HH
#define OSTD_INTERNAL_TUPLE_HH
#include "octa/types.hh"
#include "octa/type_traits.hh"
#include "ostd/types.hh"
#include "ostd/type_traits.hh"
namespace ostd {

View File

@ -3,15 +3,15 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_IO_HH
#define OCTA_IO_HH
#ifndef OSTD_IO_HH
#define OSTD_IO_HH
#include <stdio.h>
#include "octa/platform.hh"
#include "octa/string.hh"
#include "octa/stream.hh"
#include "octa/format.hh"
#include "ostd/platform.hh"
#include "ostd/string.hh"
#include "ostd/stream.hh"
#include "ostd/format.hh"
namespace ostd {
@ -87,7 +87,7 @@ struct FileStream: Stream {
}
bool seek(StreamOffset pos, StreamSeek whence = StreamSeek::set) {
#ifndef OCTA_PLATFORM_WIN32
#ifndef OSTD_PLATFORM_WIN32
return fseeko(p_f, pos, int(whence)) >= 0;
#else
return _fseeki64(p_f, pos, int(whence)) >= 0;
@ -95,7 +95,7 @@ struct FileStream: Stream {
}
StreamOffset tell() const {
#ifndef OCTA_PLATFORM_WIN32
#ifndef OSTD_PLATFORM_WIN32
return ftello(p_f);
#else
return _ftelli64(p_f);

View File

@ -3,16 +3,16 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_MAP_HH
#define OCTA_MAP_HH
#ifndef OSTD_MAP_HH
#define OSTD_MAP_HH
#include "octa/types.hh"
#include "octa/utility.hh"
#include "octa/memory.hh"
#include "octa/functional.hh"
#include "octa/initializer_list.hh"
#include "ostd/types.hh"
#include "ostd/utility.hh"
#include "ostd/memory.hh"
#include "ostd/functional.hh"
#include "ostd/initializer_list.hh"
#include "octa/internal/hashtable.hh"
#include "ostd/internal/hashtable.hh"
namespace ostd {

View File

@ -3,15 +3,15 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_MAYBE_HH
#define OCTA_MAYBE_HH
#ifndef OSTD_MAYBE_HH
#define OSTD_MAYBE_HH
#include "octa/types.hh"
#include "octa/type_traits.hh"
#include "octa/memory.hh"
#include "octa/utility.hh"
#include "octa/initializer_list.hh"
#include "octa/functional.hh"
#include "ostd/types.hh"
#include "ostd/type_traits.hh"
#include "ostd/memory.hh"
#include "ostd/utility.hh"
#include "ostd/initializer_list.hh"
#include "ostd/functional.hh"
namespace ostd {

View File

@ -3,14 +3,14 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_MEMORY_HH
#define OCTA_MEMORY_HH
#ifndef OSTD_MEMORY_HH
#define OSTD_MEMORY_HH
#include <stddef.h>
#include "octa/new.hh"
#include "octa/utility.hh"
#include "octa/type_traits.hh"
#include "ostd/new.hh"
#include "ostd/utility.hh"
#include "ostd/type_traits.hh"
namespace ostd {
/* address of */

View File

@ -3,11 +3,11 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_NEW_HH
#define OCTA_NEW_HH
#ifndef OSTD_NEW_HH
#define OSTD_NEW_HH
#ifndef OCTA_ALLOW_CXXSTD
#include "octa/types.hh"
#ifndef OSTD_ALLOW_CXXSTD
#include "ostd/types.hh"
inline void *operator new (ostd::Size, void *p) { return p; }
inline void *operator new [](ostd::Size, void *p) { return p; }

View File

@ -3,77 +3,77 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_PLATFORM_HH
#define OCTA_PLATFORM_HH
#ifndef OSTD_PLATFORM_HH
#define OSTD_PLATFORM_HH
#include <stdint.h>
#if defined(WIN32) || defined(_WIN32) || (defined(__WIN32) && !defined(__CYGWIN__))
# define OCTA_PLATFORM_WIN32 1
# define OSTD_PLATFORM_WIN32 1
# if defined(WIN64) || defined(_WIN64)
# define OCTA_PLATFORM_WIN64 1
# define OSTD_PLATFORM_WIN64 1
# endif
#else
# define OCTA_PLATFORM_POSIX 1
# define OSTD_PLATFORM_POSIX 1
# if defined(__linux__)
# define OCTA_PLATFORM_LINUX 1
# define OSTD_PLATFORM_LINUX 1
# endif
# if defined(__APPLE__)
# define OCTA_PLATFORM_OSX 1
# define OSTD_PLATFORM_OSX 1
# endif
# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
# define OCTA_PLATFORM_FREEBSD 1
# define OCTA_PLATFORM_BSD 1
# define OSTD_PLATFORM_FREEBSD 1
# define OSTD_PLATFORM_BSD 1
# endif
# if defined(__NetBSD__)
# define OCTA_PLATFORM_NETBSD 1
# define OCTA_PLATFORM_BSD 1
# define OSTD_PLATFORM_NETBSD 1
# define OSTD_PLATFORM_BSD 1
# endif
# if defined(__OpenBSD__)
# define OCTA_PLATFORM_OPENBSD 1
# define OCTA_PLATFORM_BSD 1
# define OSTD_PLATFORM_OPENBSD 1
# define OSTD_PLATFORM_BSD 1
# endif
# if defined(__DragonFly__)
# define OCTA_PLATFORM_DRAGONFLYBSD 1
# define OCTA_PLATFORM_BSD 1
# define OSTD_PLATFORM_DRAGONFLYBSD 1
# define OSTD_PLATFORM_BSD 1
# endif
# if defined(sun) || defined(__sun)
# define OCTA_PLATFORM_SOLARIS 1
# define OSTD_PLATFORM_SOLARIS 1
# endif
#endif
#if defined(__clang__)
# define OCTA_TOOLCHAIN_CLANG 1
# define OSTD_TOOLCHAIN_CLANG 1
#endif
#if defined(__GNUC__)
# define OCTA_TOOLCHAIN_GNU 1
# define OSTD_TOOLCHAIN_GNU 1
#endif
#if defined(_MSC_VER)
# define OCTA_TOOLCHAIN_MSVC 1
# define OSTD_TOOLCHAIN_MSVC 1
#endif
#define OCTA_ENDIAN_LIL 1234
#define OCTA_ENDIAN_BIG 4321
#define OSTD_ENDIAN_LIL 1234
#define OSTD_ENDIAN_BIG 4321
#ifdef OCTA_PLATFORM_LINUX
#ifdef OSTD_PLATFORM_LINUX
# include <endian.h>
# define OCTA_BYTE_ORDER __BYTE_ORDER
# define OSTD_BYTE_ORDER __BYTE_ORDER
#else
# if defined(__BIG_ENDIAN__) || defined(__ARMEB__) || defined(__THUMBEB__) || \
defined(__AARCH64EB__) || defined(__MIPSEB__) || defined(__MIPSEB) || \
defined(_MIPSEB) || defined(__ppc__) || defined(__POWERPC__) || \
defined(_M_PPC) || defined(__sparc__)
# define OCTA_BYTE_ORDER OCTA_ENDIAN_BIG
# define OSTD_BYTE_ORDER OSTD_ENDIAN_BIG
# else
# define OCTA_BYTE_ORDER OCTA_ENDIAN_LIL
# define OSTD_BYTE_ORDER OSTD_ENDIAN_LIL
# endif
#endif
namespace ostd {
#if defined(OCTA_TOOLCHAIN_GNU)
#if defined(OSTD_TOOLCHAIN_GNU)
/* using gcc/clang builtins */
inline uint16_t endian_swap16(uint16_t x) {
@ -86,7 +86,7 @@ inline uint64_t endian_swap64(uint64_t x) {
return __builtin_bswap64(x);
}
#elif defined(OCTA_TOOLCHAIN_MSVC)
#elif defined(OSTD_TOOLCHAIN_MSVC)
/* using msvc builtins */
inline uint16_t endian_swap16(uint16_t x) {

View File

@ -3,16 +3,16 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_RANGE_HH
#define OCTA_RANGE_HH
#ifndef OSTD_RANGE_HH
#define OSTD_RANGE_HH
#include <stddef.h>
#include <string.h>
#include "octa/new.hh"
#include "octa/types.hh"
#include "octa/utility.hh"
#include "octa/type_traits.hh"
#include "ostd/new.hh"
#include "ostd/types.hh"
#include "ostd/utility.hh"
#include "ostd/type_traits.hh"
namespace ostd {
@ -25,7 +25,7 @@ struct FiniteRandomAccessRangeTag: RandomAccessRangeTag {};
template<typename T> struct RangeHalf;
#define OCTA_RANGE_TRAIT(Name) \
#define OSTD_RANGE_TRAIT(Name) \
namespace detail { \
template<typename T> \
struct Range##Name##Test { \
@ -43,13 +43,13 @@ namespace detail { \
template<typename T> \
using Range##Name = typename detail::Range##Name##Base<T>::Type;
OCTA_RANGE_TRAIT(Category)
OCTA_RANGE_TRAIT(Size)
OCTA_RANGE_TRAIT(Value)
OCTA_RANGE_TRAIT(Reference)
OCTA_RANGE_TRAIT(Difference)
OSTD_RANGE_TRAIT(Category)
OSTD_RANGE_TRAIT(Size)
OSTD_RANGE_TRAIT(Value)
OSTD_RANGE_TRAIT(Reference)
OSTD_RANGE_TRAIT(Difference)
#undef OCTA_RANGE_TRAIT
#undef OSTD_RANGE_TRAIT
namespace detail {
template<typename T>

View File

@ -3,16 +3,16 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_SET_HH
#define OCTA_SET_HH
#ifndef OSTD_SET_HH
#define OSTD_SET_HH
#include "octa/types.hh"
#include "octa/utility.hh"
#include "octa/memory.hh"
#include "octa/functional.hh"
#include "octa/initializer_list.hh"
#include "ostd/types.hh"
#include "ostd/utility.hh"
#include "ostd/memory.hh"
#include "ostd/functional.hh"
#include "ostd/initializer_list.hh"
#include "octa/internal/hashtable.hh"
#include "ostd/internal/hashtable.hh"
namespace ostd {

View File

@ -3,22 +3,22 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_STREAM_HH
#define OCTA_STREAM_HH
#ifndef OSTD_STREAM_HH
#define OSTD_STREAM_HH
#include <sys/types.h>
#include "octa/platform.hh"
#include "octa/types.hh"
#include "octa/range.hh"
#include "octa/type_traits.hh"
#include "octa/string.hh"
#include "octa/utility.hh"
#include "octa/format.hh"
#include "ostd/platform.hh"
#include "ostd/types.hh"
#include "ostd/range.hh"
#include "ostd/type_traits.hh"
#include "ostd/string.hh"
#include "ostd/utility.hh"
#include "ostd/format.hh"
namespace ostd {
#ifndef OCTA_PLATFORM_WIN32
#ifndef OSTD_PLATFORM_WIN32
using StreamOffset = off_t;
#else
using StreamOffset = __int64;

View File

@ -3,15 +3,15 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_STRING_HH
#define OCTA_STRING_HH
#ifndef OSTD_STRING_HH
#define OSTD_STRING_HH
#include <stdio.h>
#include <stddef.h>
#include "octa/utility.hh"
#include "octa/range.hh"
#include "octa/vector.hh"
#include "ostd/utility.hh"
#include "ostd/range.hh"
#include "ostd/vector.hh"
namespace ostd {
static constexpr Size npos = -1;
@ -729,7 +729,7 @@ template<> struct ToString<char> {
}
};
#define OCTA_TOSTR_NUM(T, fmt) \
#define OSTD_TOSTR_NUM(T, fmt) \
template<> struct ToString<T> { \
using Argument = T; \
using Result = String; \
@ -740,21 +740,21 @@ template<> struct ToString<T> { \
} \
};
OCTA_TOSTR_NUM(sbyte, "%d")
OCTA_TOSTR_NUM(int, "%d")
OCTA_TOSTR_NUM(int &, "%d")
OCTA_TOSTR_NUM(long, "%ld")
OCTA_TOSTR_NUM(float, "%f")
OCTA_TOSTR_NUM(double, "%f")
OSTD_TOSTR_NUM(sbyte, "%d")
OSTD_TOSTR_NUM(int, "%d")
OSTD_TOSTR_NUM(int &, "%d")
OSTD_TOSTR_NUM(long, "%ld")
OSTD_TOSTR_NUM(float, "%f")
OSTD_TOSTR_NUM(double, "%f")
OCTA_TOSTR_NUM(byte, "%u")
OCTA_TOSTR_NUM(uint, "%u")
OCTA_TOSTR_NUM(ulong, "%lu")
OCTA_TOSTR_NUM(llong, "%lld")
OCTA_TOSTR_NUM(ullong, "%llu")
OCTA_TOSTR_NUM(ldouble, "%Lf")
OSTD_TOSTR_NUM(byte, "%u")
OSTD_TOSTR_NUM(uint, "%u")
OSTD_TOSTR_NUM(ulong, "%lu")
OSTD_TOSTR_NUM(llong, "%lld")
OSTD_TOSTR_NUM(ullong, "%llu")
OSTD_TOSTR_NUM(ldouble, "%Lf")
#undef OCTA_TOSTR_NUM
#undef OSTD_TOSTR_NUM
template<typename T> struct ToString<T *> {
using Argument = T *;

View File

@ -3,15 +3,15 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_TUPLE_HH
#define OCTA_TUPLE_HH
#ifndef OSTD_TUPLE_HH
#define OSTD_TUPLE_HH
#include "octa/internal/tuple.hh"
#include "ostd/internal/tuple.hh"
#include "octa/types.hh"
#include "octa/type_traits.hh"
#include "octa/memory.hh"
#include "octa/utility.hh"
#include "ostd/types.hh"
#include "ostd/type_traits.hh"
#include "ostd/memory.hh"
#include "ostd/utility.hh"
namespace ostd {

View File

@ -3,12 +3,12 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_TYPE_TRAITS_HH
#define OCTA_TYPE_TRAITS_HH
#ifndef OSTD_TYPE_TRAITS_HH
#define OSTD_TYPE_TRAITS_HH
#include <stddef.h>
#include "octa/types.hh"
#include "ostd/types.hh"
namespace ostd {
/* forward declarations */
@ -403,16 +403,16 @@ struct HasVirtualDestructor: IntegralConstant<bool,
/* is constructible */
namespace detail {
#define OCTA_MOVE(v) static_cast<RemoveReference<decltype(v)> &&>(v)
#define OSTD_MOVE(v) static_cast<RemoveReference<decltype(v)> &&>(v)
template<typename, typename T> struct Select2nd { using Type = T; };
struct Any { Any(...); };
template<typename T, typename ...A> typename Select2nd<
decltype(OCTA_MOVE(T(declval_in<A>()...))), True
decltype(OSTD_MOVE(T(declval_in<A>()...))), True
>::Type is_ctible_test(T &&, A &&...);
#undef OCTA_MOVE
#undef OSTD_MOVE
template<typename ...A> False is_ctible_test(Any, A &&...);
@ -1069,35 +1069,35 @@ using Conditional = typename detail::ConditionalBase<_cond, T, U>::Type;
/* result of call at compile time */
namespace detail {
#define OCTA_FWD(T, _v) static_cast<T &&>(_v)
#define OSTD_FWD(T, _v) static_cast<T &&>(_v)
template<typename F, typename ...A>
inline auto rof_invoke(F &&f, A &&...args) ->
decltype(OCTA_FWD(F, f)(OCTA_FWD(A, args)...)) {
return OCTA_FWD(F, f)(OCTA_FWD(A, args)...);
decltype(OSTD_FWD(F, f)(OSTD_FWD(A, args)...)) {
return OSTD_FWD(F, f)(OSTD_FWD(A, args)...);
}
template<typename B, typename T, typename D>
inline auto rof_invoke(T B::*pmd, D &&ref) ->
decltype(OCTA_FWD(D, ref).*pmd) {
return OCTA_FWD(D, ref).*pmd;
decltype(OSTD_FWD(D, ref).*pmd) {
return OSTD_FWD(D, ref).*pmd;
}
template<typename PMD, typename P>
inline auto rof_invoke(PMD &&pmd, P &&ptr) ->
decltype((*OCTA_FWD(P, ptr)).*OCTA_FWD(PMD, pmd)) {
return (*OCTA_FWD(P, ptr)).*OCTA_FWD(PMD, pmd);
decltype((*OSTD_FWD(P, ptr)).*OSTD_FWD(PMD, pmd)) {
return (*OSTD_FWD(P, ptr)).*OSTD_FWD(PMD, pmd);
}
template<typename B, typename T, typename D, typename ...A>
inline auto rof_invoke(T B::*pmf, D &&ref, A &&...args) ->
decltype((OCTA_FWD(D, ref).*pmf)(OCTA_FWD(A, args)...)) {
return (OCTA_FWD(D, ref).*pmf)(OCTA_FWD(A, args)...);
decltype((OSTD_FWD(D, ref).*pmf)(OSTD_FWD(A, args)...)) {
return (OSTD_FWD(D, ref).*pmf)(OSTD_FWD(A, args)...);
}
template<typename PMF, typename P, typename ...A>
inline auto rof_invoke(PMF &&pmf, P &&ptr, A &&...args) ->
decltype(((*OCTA_FWD(P, ptr)).*OCTA_FWD(PMF, pmf))
(OCTA_FWD(A, args)...)) {
return ((*OCTA_FWD(P, ptr)).*OCTA_FWD(PMF, pmf))
(OCTA_FWD(A, args)...);
decltype(((*OSTD_FWD(P, ptr)).*OSTD_FWD(PMF, pmf))
(OSTD_FWD(A, args)...)) {
return ((*OSTD_FWD(P, ptr)).*OSTD_FWD(PMF, pmf))
(OSTD_FWD(A, args)...);
}
#undef OCTA_FWD
#undef OSTD_FWD
template<typename, typename = void>
struct ResultOfCore {};

View File

@ -3,8 +3,8 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_TYPES_HH
#define OCTA_TYPES_HH
#ifndef OSTD_TYPES_HH
#define OSTD_TYPES_HH
#include <stdint.h>
#include <stddef.h>

View File

@ -3,13 +3,13 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_UTILITY_HH
#define OCTA_UTILITY_HH
#ifndef OSTD_UTILITY_HH
#define OSTD_UTILITY_HH
#include <stddef.h>
#include "octa/type_traits.hh"
#include "octa/internal/tuple.hh"
#include "ostd/type_traits.hh"
#include "ostd/internal/tuple.hh"
namespace ostd {

View File

@ -3,18 +3,18 @@
* This file is part of OctaSTD. See COPYING.md for futher information.
*/
#ifndef OCTA_VECTOR_HH
#define OCTA_VECTOR_HH
#ifndef OSTD_VECTOR_HH
#define OSTD_VECTOR_HH
#include <string.h>
#include <stddef.h>
#include "octa/type_traits.hh"
#include "octa/utility.hh"
#include "octa/range.hh"
#include "octa/algorithm.hh"
#include "octa/initializer_list.hh"
#include "octa/memory.hh"
#include "ostd/type_traits.hh"
#include "ostd/utility.hh"
#include "ostd/range.hh"
#include "ostd/algorithm.hh"
#include "ostd/initializer_list.hh"
#include "ostd/memory.hh"
namespace ostd {

View File

@ -5,7 +5,7 @@
#include <stdlib.h>
#include "octa/types.hh"
#include "ostd/types.hh"
void *operator new(ostd::Size size) {
void *p = malloc(size);

View File

@ -1,7 +1,7 @@
#include <assert.h>
#include <string.h>
#include "octa/array.hh"
#include "octa/string.hh"
#include "ostd/array.hh"
#include "ostd/string.hh"
using namespace ostd;

View File

@ -1,7 +1,7 @@
#include <assert.h>
#include <string.h>
#include "octa/utility.hh"
#include "octa/string.hh"
#include "ostd/utility.hh"
#include "ostd/string.hh"
using namespace ostd;

View File

@ -1,7 +1,7 @@
#include <assert.h>
#include <string.h>
#include "octa/vector.hh"
#include "octa/string.hh"
#include "ostd/vector.hh"
#include "ostd/string.hh"
using namespace ostd;