- Removed Double Underscores for portability

This commit is contained in:
2025-07-26 21:13:32 -04:00
parent 7493b5252a
commit d02a51fd8d
51 changed files with 279 additions and 279 deletions

View File

@@ -70,17 +70,17 @@
using assert_handler = void (*)(const char *, const char *, int , const char *);
void __assert_impl(const char* expression, const char* file, int line, const char* function, const char* desc, bool halt);
void _assert_impl(const char* expression, const char* file, int line, const char* function, const char* desc, bool halt);
// flagged unlikely to optimize branch prediction
#define assert(expression, description) \
if(not(expression)) [[unlikely]] { \
__assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, not FENNEC_RELEASE); \
_assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, not FENNEC_RELEASE); \
}
#define assertf(expression, description) \
if(not(expression)) [[unlikely]] { \
__assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, true); \
_assert_impl(#expression, __FILE__, __LINE__, __PRETTY_FUNCTION__, description, true); \
}
#if FENNEC_RELEASE

View File

@@ -81,7 +81,7 @@
#include <fennec/lang/intrinsics.h>
#include <fennec/memory/common.h>
#include <fennec/lang/detail/__bits.h>
#include <fennec/lang/detail/_bits.h>
namespace fennec
{
@@ -126,7 +126,7 @@ constexpr void* bit_and(void* arr, const void* mask, size_t n) {
const uint8_t* s = static_cast<const uint8_t*>(mask);
while (n > 0) {
const size_t step = detail::__bit_and(d, s, n);
const size_t step = detail::_bit_and(d, s, n);
d += step; s += step; n -= step;
}
@@ -167,7 +167,7 @@ constexpr void* bit_or(void* arr, const void* mask, size_t n) {
const uint8_t* s = static_cast<const uint8_t*>(mask);
while (n > 0)
{
const size_t step = detail::__bit_or(d, s, n);
const size_t step = detail::_bit_or(d, s, n);
d += step; s += step; n -= step;
}
@@ -207,7 +207,7 @@ constexpr void* bit_xor(void* arr, const void* mask, size_t n) {
uint8_t* d = static_cast<uint8_t*>(arr);
const uint8_t* s = static_cast<const uint8_t*>(mask);
while (n > 0) {
const size_t step = detail::__bit_xor(d, s, n);
const size_t step = detail::_bit_xor(d, s, n);
d += step; s += step; n -= step;
}

View File

@@ -1,59 +0,0 @@
// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
#ifndef FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
#define FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
#include <fennec/lang/types.h>
#include <fennec/lang/type_transforms.h>
namespace fennec::detail
{
template<typename> struct __make_unsigned : type_identity<undefined_t> {};
template<> struct __make_unsigned<char_t> : type_identity<uchar_t> {};
template<> struct __make_unsigned<uchar_t> : type_identity<uchar_t> {};
template<> struct __make_unsigned<schar_t> : type_identity<uchar_t> {};
template<> struct __make_unsigned<short_t> : type_identity<ushort_t> {};
template<> struct __make_unsigned<ushort_t> : type_identity<ushort_t> {};
template<> struct __make_unsigned<uint_t> : type_identity<uint_t> {};
template<> struct __make_unsigned<int_t> : type_identity<uint_t> {};
template<> struct __make_unsigned<long_t> : type_identity<ulong_t> {};
template<> struct __make_unsigned<ulong_t> : type_identity<ulong_t> {};
template<> struct __make_unsigned<llong_t> : type_identity<ullong_t> {};
template<> struct __make_unsigned<ullong_t> : type_identity<ullong_t> {};
template<typename> struct __make_signed : type_identity<undefined_t> {};
template<> struct __make_signed<char_t> : type_identity<schar_t> {};
template<> struct __make_signed<uchar_t> : type_identity<schar_t> {};
template<> struct __make_signed<schar_t> : type_identity<schar_t> {};
template<> struct __make_signed<short_t> : type_identity<short_t> {};
template<> struct __make_signed<ushort_t> : type_identity<short_t> {};
template<> struct __make_signed<uint_t> : type_identity<int_t> {};
template<> struct __make_signed<int_t> : type_identity<int_t> {};
template<> struct __make_signed<long_t> : type_identity<long_t> {};
template<> struct __make_signed<ulong_t> : type_identity<long_t> {};
template<> struct __make_signed<llong_t> : type_identity<llong_t> {};
template<> struct __make_signed<ullong_t> : type_identity<llong_t> {};
}
#endif // FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H

View File

@@ -1,75 +0,0 @@
// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
#ifndef FENNEC_LANG_DETAIL_TYPE_TRAITS_H
#define FENNEC_LANG_DETAIL_TYPE_TRAITS_H
#include <fennec/lang/constants.h>
#include <fennec/lang/float.h>
namespace fennec::detail
{
// Nothing interesting to note here
template<typename> struct __is_void : false_type {};
template<> struct __is_void<void> : true_type {};
template<typename> struct __is_bool : false_type {};
template<> struct __is_bool<bool_t> : true_type {};
template<typename> struct __is_null_pointer : false_type {};
template<> struct __is_null_pointer<nullptr_t> : true_type {};
// Provides definitions for all builtin int types
template<typename> struct __is_integral : false_type {};
template<> struct __is_integral<bool_t> : true_type {};
template<> struct __is_integral<char_t> : true_type {};
template<> struct __is_integral<char8_t> : true_type {};
template<> struct __is_integral<char16_t> : true_type {};
template<> struct __is_integral<char32_t> : true_type {};
template<> struct __is_integral<schar_t> : true_type {};
template<> struct __is_integral<uchar_t> : true_type {};
template<> struct __is_integral<wchar_t> : true_type {};
template<> struct __is_integral<short_t> : true_type {};
template<> struct __is_integral<ushort_t> : true_type {};
template<> struct __is_integral<int_t> : true_type {};
template<> struct __is_integral<uint_t> : true_type {};
template<> struct __is_integral<long_t> : true_type {};
template<> struct __is_integral<ulong_t> : true_type {};
template<> struct __is_integral<llong_t> : true_type {};
template<> struct __is_integral<ullong_t> : true_type {};
// Most unsigned types will underflow `-1` to the types maximum value
template<typename TypeT> struct __is_signed : bool_constant<TypeT(-1) < TypeT(0)> {};
template<typename TypeT> struct __is_unsigned : bool_constant<TypeT(-1) >= TypeT(0)> {};
template<typename> struct __is_floating_point : false_type {};
template<> struct __is_floating_point<float_t> : true_type {};
template<> struct __is_floating_point<double_t> : true_type {};
template<typename> struct __is_pointer : false_type {};
template<typename T> struct __is_pointer<T*> : true_type {};
template<typename T, typename U = T&&> U __declval(int);
template<typename T> T __declval(long);
template<typename T> struct __declval_protector : bool_constant<false> {};
}
#endif // FENNEC_LANG_DETAIL_TYPE_TRAITS_H

View File

@@ -25,112 +25,112 @@ namespace fennec::detail
{
// helper for bitwise and for 1 byte
constexpr size_t __bit_and_8(void* dst, const void* src) {
constexpr size_t _bit_and_8(void* dst, const void* src) {
*static_cast<uint8_t*>(dst) = *static_cast<uint8_t*>(dst) & *static_cast<const uint8_t*>(src); return 1;
}
// helper for bitwise and 2 bytes at once
constexpr size_t __bit_and_16(void* dst, const void* src) {
constexpr size_t _bit_and_16(void* dst, const void* src) {
*static_cast<uint16_t*>(dst) = *static_cast<uint16_t*>(dst) & *static_cast<const uint16_t*>(src); return 2;
}
// helper for bitwise and 4 bytes at once
constexpr size_t __bit_and_32(void* dst, const void* src) {
constexpr size_t _bit_and_32(void* dst, const void* src) {
*static_cast<uint32_t*>(dst) = *static_cast<uint32_t*>(dst) & *static_cast<const uint32_t*>(src); return 4;
}
// helper for bitwise and 8 bytes at once
constexpr size_t __bit_and_64(void* dst, const void* src) {
constexpr size_t _bit_and_64(void* dst, const void* src) {
*static_cast<uint64_t*>(dst) = *static_cast<uint64_t*>(dst) & *static_cast<const uint64_t*>(src); return 8;
}
// helper for selecting size
constexpr size_t __bit_and(void* dst, const void* src, size_t n) {
constexpr size_t _bit_and(void* dst, const void* src, size_t n) {
switch (n) {
case 0:
return 0;
case 1:
return __bit_and_8(dst, src);
return _bit_and_8(dst, src);
case 2: case 3:
return __bit_and_16(dst, src);
return _bit_and_16(dst, src);
case 4: case 5: case 6: case 7:
return __bit_and_32(dst, src);
return _bit_and_32(dst, src);
default:
return __bit_and_64(dst, src);
return _bit_and_64(dst, src);
}
}
// helper for bitwise or for 1 byte
constexpr size_t __bit_or_8(void* dst, const void* src) {
constexpr size_t _bit_or_8(void* dst, const void* src) {
*static_cast<uint8_t*>(dst) = *static_cast<uint8_t*>(dst) | *static_cast<const uint8_t*>(src); return 1;
}
// helper for bitwise or 2 bytes at once
constexpr size_t __bit_or_16(void* dst, const void* src) {
constexpr size_t _bit_or_16(void* dst, const void* src) {
*static_cast<uint16_t*>(dst) = *static_cast<uint16_t*>(dst) | *static_cast<const uint16_t*>(src); return 2;
}
// helper for bitwise or 4 bytes at once
constexpr size_t __bit_or_32(void* dst, const void* src) {
constexpr size_t _bit_or_32(void* dst, const void* src) {
*static_cast<uint32_t*>(dst) = *static_cast<uint32_t*>(dst) | *static_cast<const uint32_t*>(src); return 4;
}
// helper for bitwise or 8 bytes at once
constexpr size_t __bit_or_64(void* dst, const void* src) {
constexpr size_t _bit_or_64(void* dst, const void* src) {
*static_cast<uint64_t*>(dst) = *static_cast<uint64_t*>(dst) | *static_cast<const uint64_t*>(src); return 8;
}
// helper for selecting size
constexpr size_t __bit_or(void* dst, const void* src, size_t n) {
constexpr size_t _bit_or(void* dst, const void* src, size_t n) {
switch (n) {
case 0:
return 0;
case 1:
return __bit_or_8(dst, src);
return _bit_or_8(dst, src);
case 2: case 3:
return __bit_or_16(dst, src);
return _bit_or_16(dst, src);
case 4: case 5: case 6: case 7:
return __bit_or_32(dst, src);
return _bit_or_32(dst, src);
default:
return __bit_or_64(dst, src);
return _bit_or_64(dst, src);
}
}
// helper for bitwise and 1 byte
constexpr size_t __bit_xor_8(void* dst, const void* src) {
constexpr size_t _bit_xor_8(void* dst, const void* src) {
*static_cast<uint8_t*>(dst) = *static_cast<uint8_t*>(dst) ^ *static_cast<const uint8_t*>(src); return 1;
}
// helper for bitwise xor 2 bytes at once
constexpr size_t __bit_xor_16(void* dst, const void* src) {
constexpr size_t _bit_xor_16(void* dst, const void* src) {
*static_cast<uint16_t*>(dst) = *static_cast<uint16_t*>(dst) ^ *static_cast<const uint16_t*>(src); return 2;
}
// helper for bitwise xor 4 bytes at once
constexpr size_t __bit_xor_32(void* dst, const void* src) {
constexpr size_t _bit_xor_32(void* dst, const void* src) {
*static_cast<uint32_t*>(dst) = *static_cast<uint32_t*>(dst) ^ *static_cast<const uint32_t*>(src); return 4;
}
// helper for bitwise xor 8 bytes at once
constexpr size_t __bit_xor_64(void* dst, const void* src) {
constexpr size_t _bit_xor_64(void* dst, const void* src) {
*static_cast<uint64_t*>(dst) = *static_cast<uint64_t*>(dst) ^ *static_cast<const uint64_t*>(src); return 8;
}
// helper for selecting size
constexpr size_t __bit_xor(void* dst, const void* src, size_t n) {
constexpr size_t _bit_xor(void* dst, const void* src, size_t n) {
switch (n) {
case 0:
return 0;
case 1:
return __bit_xor_8(dst, src);
return _bit_xor_8(dst, src);
case 2: case 3:
return __bit_xor_16(dst, src);
return _bit_xor_16(dst, src);
case 4: case 5: case 6: case 7:
return __bit_xor_32(dst, src);
return _bit_xor_32(dst, src);
default:
return __bit_xor_64(dst, src);
return _bit_xor_64(dst, src);
}
}

View File

@@ -0,0 +1,59 @@
// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
#ifndef FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
#define FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H
#include <fennec/lang/types.h>
#include <fennec/lang/type_transforms.h>
namespace fennec::detail
{
template<typename> struct _make_unsigned : type_identity<undefined_t> {};
template<> struct _make_unsigned<char_t> : type_identity<uchar_t> {};
template<> struct _make_unsigned<uchar_t> : type_identity<uchar_t> {};
template<> struct _make_unsigned<schar_t> : type_identity<uchar_t> {};
template<> struct _make_unsigned<short_t> : type_identity<ushort_t> {};
template<> struct _make_unsigned<ushort_t> : type_identity<ushort_t> {};
template<> struct _make_unsigned<uint_t> : type_identity<uint_t> {};
template<> struct _make_unsigned<int_t> : type_identity<uint_t> {};
template<> struct _make_unsigned<long_t> : type_identity<ulong_t> {};
template<> struct _make_unsigned<ulong_t> : type_identity<ulong_t> {};
template<> struct _make_unsigned<llong_t> : type_identity<ullong_t> {};
template<> struct _make_unsigned<ullong_t> : type_identity<ullong_t> {};
template<typename> struct _make_signed : type_identity<undefined_t> {};
template<> struct _make_signed<char_t> : type_identity<schar_t> {};
template<> struct _make_signed<uchar_t> : type_identity<schar_t> {};
template<> struct _make_signed<schar_t> : type_identity<schar_t> {};
template<> struct _make_signed<short_t> : type_identity<short_t> {};
template<> struct _make_signed<ushort_t> : type_identity<short_t> {};
template<> struct _make_signed<uint_t> : type_identity<int_t> {};
template<> struct _make_signed<int_t> : type_identity<int_t> {};
template<> struct _make_signed<long_t> : type_identity<long_t> {};
template<> struct _make_signed<ulong_t> : type_identity<long_t> {};
template<> struct _make_signed<llong_t> : type_identity<llong_t> {};
template<> struct _make_signed<ullong_t> : type_identity<llong_t> {};
}
#endif // FENNEC_LANG_DETAIL_NUMERIC_TRANSFORMS_H

View File

@@ -24,16 +24,16 @@
namespace fennec::detail
{
template<typename FirstT, typename... RestT> struct __first_element : type_identity<FirstT> {};
template<typename FirstT, typename... RestT> struct _first_element : type_identity<FirstT> {};
template<size_t n, size_t i, typename...TypesT> struct __nth_element;
template<size_t n, size_t i, typename...TypesT> struct _nth_element;
template<size_t n, size_t i> struct __nth_element<n, i> : type_identity<void> {};
template<size_t n, size_t i> struct _nth_element<n, i> : type_identity<void> {};
template<size_t n, size_t i, typename HeadT, typename...RestT>
struct __nth_element<n, i, HeadT, RestT...> : conditional<
struct _nth_element<n, i, HeadT, RestT...> : conditional<
n == i, type_identity<HeadT>,
__nth_element<n, i + 1, RestT...>
_nth_element<n, i + 1, RestT...>
> {};
}

View File

@@ -0,0 +1,75 @@
// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
#ifndef FENNEC_LANG_DETAIL_TYPE_TRAITS_H
#define FENNEC_LANG_DETAIL_TYPE_TRAITS_H
#include <fennec/lang/constants.h>
#include <fennec/lang/float.h>
namespace fennec::detail
{
// Nothing interesting to note here
template<typename> struct _is_void : false_type {};
template<> struct _is_void<void> : true_type {};
template<typename> struct _is_bool : false_type {};
template<> struct _is_bool<bool_t> : true_type {};
template<typename> struct _is_null_pointer : false_type {};
template<> struct _is_null_pointer<nullptr_t> : true_type {};
// Provides definitions for all builtin int types
template<typename> struct _is_integral : false_type {};
template<> struct _is_integral<bool_t> : true_type {};
template<> struct _is_integral<char_t> : true_type {};
template<> struct _is_integral<char8_t> : true_type {};
template<> struct _is_integral<char16_t> : true_type {};
template<> struct _is_integral<char32_t> : true_type {};
template<> struct _is_integral<schar_t> : true_type {};
template<> struct _is_integral<uchar_t> : true_type {};
template<> struct _is_integral<wchar_t> : true_type {};
template<> struct _is_integral<short_t> : true_type {};
template<> struct _is_integral<ushort_t> : true_type {};
template<> struct _is_integral<int_t> : true_type {};
template<> struct _is_integral<uint_t> : true_type {};
template<> struct _is_integral<long_t> : true_type {};
template<> struct _is_integral<ulong_t> : true_type {};
template<> struct _is_integral<llong_t> : true_type {};
template<> struct _is_integral<ullong_t> : true_type {};
// Most unsigned types will underflow `-1` to the types maximum value
template<typename TypeT> struct _is_signed : bool_constant<TypeT(-1) < TypeT(0)> {};
template<typename TypeT> struct _is_unsigned : bool_constant<TypeT(-1) >= TypeT(0)> {};
template<typename> struct _is_floating_point : false_type {};
template<> struct _is_floating_point<float_t> : true_type {};
template<> struct _is_floating_point<double_t> : true_type {};
template<typename> struct _is_pointer : false_type {};
template<typename T> struct _is_pointer<T*> : true_type {};
template<typename T, typename U = T&&> U _declval(int);
template<typename T> T _declval(long);
template<typename T> struct _declval_protector : bool_constant<false> {};
}
#endif // FENNEC_LANG_DETAIL_TYPE_TRAITS_H

View File

@@ -25,23 +25,23 @@ namespace fennec::detail
{
template<typename _Tp, typename = void>
struct __add_lvalue_reference {
struct _add_lvalue_reference {
using type = _Tp;
};
template<typename _Tp>
struct __add_lvalue_reference<_Tp, void_t<_Tp&>> {
struct _add_lvalue_reference<_Tp, void_t<_Tp&>> {
using type = _Tp&;
};
template<typename _Tp, typename = void>
struct __add_rvalue_reference {
struct _add_rvalue_reference {
using type = _Tp;
};
template<typename _Tp>
struct __add_rvalue_reference<_Tp, void_t<_Tp&&>> {
struct _add_rvalue_reference<_Tp, void_t<_Tp&&>> {
using type = _Tp&&;
};

View File

@@ -25,7 +25,7 @@ namespace fennec::detail
{
template<typename RootT>
FENNEC_NO_INLINE uint64_t __typeuuid() {
FENNEC_NO_INLINE uint64_t _typeuuid() {
static uint64_t i = 0;
return ++i;
}

View File

@@ -55,7 +55,7 @@
/// </table>
#include <fennec/lang/type_transforms.h>
#include <fennec/lang/detail/__numeric_transforms.h>
#include <fennec/lang/detail/_numeric_transforms.h>
namespace fennec
{
@@ -63,7 +63,7 @@ namespace fennec
///
/// \brief Get the corresponding signed integral type of TypeT
/// \tparam TypeT the integral type to transform
template<typename TypeT> struct make_signed : detail::__make_signed<remove_cv_t<TypeT>> {};
template<typename TypeT> struct make_signed : detail::_make_signed<remove_cv_t<TypeT>> {};
///
/// \brief Shorthand for `typename make_signed<TypeT>::type`
@@ -73,7 +73,7 @@ template<typename TypeT> using make_signed_t = typename make_signed<TypeT>::type
///
/// \brief Get the corresponding unsigned integral type of TypeT
/// \tparam TypeT the integral type to transform
template<typename TypeT> struct make_unsigned : detail::__make_unsigned<remove_cv_t<TypeT>> {};
template<typename TypeT> struct make_unsigned : detail::_make_unsigned<remove_cv_t<TypeT>> {};
///
/// \brief Shorthand for `typename make_unsigned<TypeT>::type`

View File

@@ -54,7 +54,7 @@
/// </table>
///
#include <fennec/lang/detail/__type_sequences.h>
#include <fennec/lang/detail/_type_sequences.h>
namespace fennec
{
@@ -62,14 +62,14 @@ namespace fennec
///
/// \brief Get the first element of a template parameter pack
/// \tparam TypesT the Parameter Pack
template<typename...TypesT> struct first_element : detail::__first_element<TypesT...> {};
template<typename...TypesT> struct first_element : detail::_first_element<TypesT...> {};
///
/// \brief alias for first_element<TypesT>::type
template<typename...TypesT> using first_element_t = typename first_element<TypesT...>::type;
template<size_t n, typename...TypesT> struct nth_element : detail::__nth_element<n, 0, TypesT...> {};
template<size_t n, typename...TypesT> struct nth_element : detail::_nth_element<n, 0, TypesT...> {};
///

View File

@@ -107,16 +107,16 @@
///
#include <fennec/lang/type_transforms.h>
#include <fennec/lang/detail/__type_traits.h>
#include <fennec/lang/detail/_type_traits.h>
namespace fennec
{
// fennec::declval =====================================================================================================
template<typename T> auto declval() noexcept -> decltype(detail::__declval<T>(0)) {
static_assert(detail::__declval_protector<T>{}, "declval must not be used");
return detail::__declval<T>(0);
template<typename T> auto declval() noexcept -> decltype(detail::_declval<T>(0)) {
static_assert(detail::_declval_protector<T>{}, "declval must not be used");
return detail::_declval<T>(0);
}
constexpr inline bool is_constant_evaluated() noexcept {
@@ -136,7 +136,7 @@ constexpr inline bool is_constant_evaluated() noexcept {
/// \details Stores a boolean value in `is_void::value`, representing whether the provided type is of base type void.
/// \tparam T type to check
template<typename T> struct is_void
: detail::__is_void<remove_cvr_t<T>>{};
: detail::_is_void<remove_cvr_t<T>>{};
///
/// \brief shorthand for ```is_void<T>::value```
@@ -153,7 +153,7 @@ template<typename T> constexpr bool_t is_void_v = is_void<T>::value;
/// \details Stores a boolean value in `is_bool::value`, representing whether the provided type is of base type bool.
/// \tparam T type to check
template<typename T> struct is_bool
: detail::__is_bool<remove_cvr_t<T>>{};
: detail::_is_bool<remove_cvr_t<T>>{};
///
/// \brief shorthand for ```is_bool<T>::value```
@@ -170,7 +170,7 @@ template<typename T> constexpr bool_t is_bool_v = is_bool<T>::value;
/// \details Stores a boolean value in `is_null_pointer::value`, representing whether the provided type is of base type nullptr_t.
/// \tparam T type to check
template<typename T> struct is_null_pointer
: detail::__is_null_pointer<remove_cvr_t<T>>{};
: detail::_is_null_pointer<remove_cvr_t<T>>{};
///
/// \brief shorthand for ```is_null_pointer<T>::value```
@@ -235,7 +235,7 @@ template<typename T> constexpr size_t is_class_v = is_class<T>::value;
/// \details Stores a boolean value in `is_integral::value`, representing whether the provided type is of a base integer type.
/// \tparam T type to check
template<typename T> struct is_integral
: detail::__is_integral<remove_cvr_t<T>> {};
: detail::_is_integral<remove_cvr_t<T>> {};
///
/// \brief shorthand for ```is_integral<T>::value```
@@ -249,7 +249,7 @@ template<typename T> constexpr bool_t is_integral_v = is_integral<T>::value;
/// \details Checks if type `T` is a signed type i.e. `T(-1) < T(0)` and stores it in `is_same::value`.
/// \tparam T type to check
template<typename T> struct is_signed
: detail::__is_signed<remove_cvr_t<T>> {};
: detail::_is_signed<remove_cvr_t<T>> {};
///
/// \brief shorthand for ```is_signed<T>::value```
@@ -263,7 +263,7 @@ template<typename T> constexpr bool_t is_signed_v = is_signed<T>::value;
/// \details Checks if type `T` is an unsigned type i.e. `T(-1) > T(0)` and stores it in `is_same::value`.
/// \tparam T type to check
template<typename T> struct is_unsigned
: detail::__is_unsigned<remove_cvr_t<T>> {};
: detail::_is_unsigned<remove_cvr_t<T>> {};
///
/// \brief shorthand for ```is_unsigned<T>::value```
@@ -280,7 +280,7 @@ template<typename T> constexpr bool_t is_unsigned_v = is_unsigned<T>::value;
/// \details Checks if type `T` is a floating point type and store it in `is_same::value`.
/// \tparam T type to check
template<typename T> struct is_floating_point
: detail::__is_floating_point<remove_cvr_t<T>>{};
: detail::_is_floating_point<remove_cvr_t<T>>{};
///
/// \brief shorthand for ```is_floating_point<T>::value```
@@ -296,7 +296,7 @@ template<typename T> constexpr bool_t is_floating_point_v = is_floating_point<T>
/// \details Checks if type `T` is a floating point type and store it in `is_same::value`.
/// \tparam T type to check
template<typename T> struct is_pointer
: detail::__is_pointer<remove_cvr_t<T>>{};
: detail::_is_pointer<remove_cvr_t<T>>{};
///
/// \brief shorthand for ```is_floating_point<T>::value```

View File

@@ -32,7 +32,7 @@
#define FENNEC_LANG_TYPE_TRANSFORMS_H
#include <fennec/lang/type_identity.h>
#include <fennec/lang/detail/__type_transforms.h>
#include <fennec/lang/detail/_type_transforms.h>
///
/// \page fennec_lang_type_transforms Type Transforms
@@ -192,7 +192,7 @@ template<typename T> using remove_reference_t = typename remove_reference<T>::t
///
/// \details adds a lvalue reference to the provided type such that 'T' becomes 'T&'
/// \tparam T Reference Type
template<typename T> struct add_lvalue_reference : detail::__add_lvalue_reference<T> {};
template<typename T> struct add_lvalue_reference : detail::_add_lvalue_reference<T> {};
///
/// \brief shorthand for `typename remove_reference<T>::type`
@@ -204,7 +204,7 @@ template<typename T> using add_lvalue_reference_t = typename add_lvalue_referen
///
/// \details adds a rvalue reference to the provided type such that 'T' becomes 'T&&'
/// \tparam T Reference Type
template<typename T> struct add_rvalue_reference : detail::__add_rvalue_reference<T> {};
template<typename T> struct add_rvalue_reference : detail::_add_rvalue_reference<T> {};
///
/// \brief shorthand for `typename remove_reference<T>::type`

View File

@@ -201,7 +201,7 @@
///
///
#include <fennec/lang/detail/__int.h>
#include <fennec/lang/detail/_int.h>
#include <fennec/lang/conditional_types.h>

View File

@@ -23,7 +23,7 @@
#include <fennec/lang/types.h>
#include <fennec/lang/type_traits.h>
#include <fennec/lang/detail/__typeuuid.h>
#include <fennec/lang/detail/_typeuuid.h>
namespace fennec
{
@@ -39,7 +39,7 @@ FENNEC_NO_INLINE uint64_t typeuuid() {
if (init) return id;
init = true;
return id = detail::__typeuuid<RootT>();
return id = detail::_typeuuid<RootT>();
}
}