Skip to content

Commit

Permalink
3.13.04 release
Browse files Browse the repository at this point in the history
  • Loading branch information
rparolin committed Mar 16, 2019
1 parent 15dd3e8 commit 6089142
Show file tree
Hide file tree
Showing 15 changed files with 437 additions and 105 deletions.
6 changes: 3 additions & 3 deletions include/EASTL/chrono.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

#if defined(EA_PLATFORM_MICROSOFT) && !defined(EA_PLATFORM_MINGW)
#include <thr/xtimec.h>
#elif defined(EA_PLATFORM_PS4)
#elif defined(EA_PLATFORM_SONY)
#include <Dinkum/threads/xtimec.h>
#include <kernel.h>
#elif defined(EA_PLATFORM_APPLE)
Expand Down Expand Up @@ -544,7 +544,7 @@ namespace chrono
{
#if defined(EA_PLATFORM_MICROSOFT) && !defined(EA_PLATFORM_MINGW)
#define EASTL_NS_PER_TICK 1
#elif defined EA_PLATFORM_PS4
#elif defined EA_PLATFORM_SONY
#define EASTL_NS_PER_TICK _XTIME_NSECS_PER_TICK
#elif defined EA_PLATFORM_POSIX
#define EASTL_NS_PER_TICK _XTIME_NSECS_PER_TICK
Expand Down Expand Up @@ -585,7 +585,7 @@ namespace chrono
static auto frequency = queryFrequency(); // cache cpu frequency on first call
EA_RESTORE_VC_WARNING()
return uint64_t(frequency * queryCounter());
#elif defined EA_PLATFORM_PS4
#elif defined EA_PLATFORM_SONY
return sceKernelGetProcessTimeCounter();
#elif defined(EA_PLATFORM_APPLE)
return mach_absolute_time();
Expand Down
4 changes: 2 additions & 2 deletions include/EASTL/internal/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@
///////////////////////////////////////////////////////////////////////////////

#ifndef EASTL_VERSION
#define EASTL_VERSION "3.13.03"
#define EASTL_VERSION_N 31303
#define EASTL_VERSION "3.13.04"
#define EASTL_VERSION_N 31304
#endif


Expand Down
10 changes: 4 additions & 6 deletions include/EASTL/internal/functional_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ namespace eastl
{
// foward declaration for swap
template <typename T>
inline void swap(T& a, T& b) EA_NOEXCEPT_IF(eastl::is_nothrow_move_constructible<T>::value &&
eastl::is_nothrow_move_assignable<T>::value);
inline void swap(T& a, T& b)
EA_NOEXCEPT_IF(eastl::is_nothrow_move_constructible<T>::value&& eastl::is_nothrow_move_assignable<T>::value);


/// invoke
Expand All @@ -40,10 +40,8 @@ namespace eastl
///
template <typename R, typename C, typename T, typename... Args>
auto invoke_impl(R C::*func, T&& obj, Args&&... args) ->
typename enable_if<
is_base_of<C, decay_t<decltype(obj)>>::value,
decltype((eastl::forward<T>(obj).*func)(eastl::forward<Args>(args)...))
>::type
typename enable_if<is_base_of<C, decay_t<decltype(obj)>>::value,
decltype((eastl::forward<T>(obj).*func)(eastl::forward<Args>(args)...))>::type
{
return (eastl::forward<T>(obj).*func)(eastl::forward<Args>(args)...);
}
Expand Down
61 changes: 59 additions & 2 deletions include/EASTL/internal/type_compound.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ namespace eastl
template<typename T, unsigned N = 0> // extent uses unsigned instead of size_t.
struct extent : public eastl::extent_help<T, N> { };

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T, unsigned N = 0>
EA_CONSTEXPR auto extent_v = extent<T, N>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_array
Expand Down Expand Up @@ -324,13 +329,25 @@ namespace eastl

#endif


#if !defined(EA_COMPILER_NO_TEMPLATE_ALIASES)
template<typename From, typename To>
EA_CONSTEXPR bool is_convertible_v = is_convertible<From, To>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_nothrow_convertible
//
// https://en.cppreference.com/w/cpp/types/is_convertible
//
// template<typename From, typename To>
// struct is_explicitly_convertible
// : public is_constructible<To, From> {};
///////////////////////////////////////////////////////////////////////
// TODO(rparolin): implement type-trait



///////////////////////////////////////////////////////////////////////
// is_explicitly_convertible
//
Expand Down Expand Up @@ -367,6 +384,10 @@ namespace eastl

#define EASTL_DECLARE_UNION(T) namespace eastl{ template <> struct is_union<T> : public true_type{}; template <> struct is_union<const T> : public true_type{}; }

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_union_v = is_union<T>::value;
#endif



Expand Down Expand Up @@ -724,7 +745,7 @@ namespace eastl
template <typename T>
struct is_final : public integral_constant<bool, __is_final(T)> {};
#else
// compiler support so we always return false
// no compiler support so we always return false
template <typename T>
struct is_final : public false_type {};
#endif
Expand All @@ -733,6 +754,42 @@ namespace eastl
template<typename T>
EA_CONSTEXPR bool is_final_v = is_final<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_aggregate
//
// https://en.cppreference.com/w/cpp/language/aggregate_initialization
//
// An aggregate is one of the following types:
// * array type
// * class type (typically, struct or union), that has
// * no private or protected non-static data members
// * no user-provided constructors (explicitly defaulted or deleted constructors are allowed)
// * no user-provided, inherited, or explicit constructors
// * (explicitly defaulted or deleted constructors are allowed)
// * no virtual, private, or protected (since C++17) base classes
// * no virtual member functions
// * no default member initializers
//
///////////////////////////////////////////////////////////////////////
#if EA_COMPILER_HAS_FEATURE(is_aggregate) || defined(_MSC_VER) && (_MSC_VER >= 1916) // VS2017 15.9+
#define EASTL_TYPE_TRAIT_is_aggregate_CONFORMANCE 1

template <typename T>
struct is_aggregate : public integral_constant<bool, __is_aggregate(T)> {};
#else
#define EASTL_TYPE_TRAIT_is_aggregate_CONFORMANCE 0

// no compiler support so we always return false
template <typename T>
struct is_aggregate : public false_type {};
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <typename T>
EA_CONSTEXPR bool is_aggregate_v = is_aggregate<T>::value;
#endif
} // namespace eastl


Expand Down
15 changes: 15 additions & 0 deletions include/EASTL/internal/type_fundamental.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ namespace eastl
struct is_arithmetic
: public integral_constant<bool, is_integral<T>::value || is_floating_point<T>::value> {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_arithmetic_v = is_arithmetic<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_fundamental
Expand All @@ -225,6 +230,11 @@ namespace eastl
struct is_fundamental
: public bool_constant<is_void_v<T> || is_integral_v<T> || is_floating_point_v<T> || is_null_pointer_v<T>> {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_fundamental_v = is_fundamental<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_hat_type
Expand All @@ -243,6 +253,11 @@ namespace eastl
template <typename T>
struct is_hat_type : public eastl::is_hat_type_helper<T> {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_hat_type_v = is_hat_type<T>::value;
#endif

} // namespace eastl


Expand Down
33 changes: 31 additions & 2 deletions include/EASTL/internal/type_pod.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ namespace eastl
struct is_standard_layout : public eastl::integral_constant<bool, is_void<T>::value || is_scalar<T>::value>{};
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool is_standard_layout_v = is_standard_layout<T>::value;
#endif

#define EASTL_DECLARE_IS_STANDARD_LAYOUT(T, isStandardLayout) \
namespace eastl { \
template <> struct is_standard_layout<T> : public eastl::integral_constant<bool, isStandardLayout> { }; \
Expand Down Expand Up @@ -536,6 +541,11 @@ namespace eastl
struct has_virtual_destructor : public eastl::false_type{};
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool has_virtual_destructor_v = has_virtual_destructor<T>::value;
#endif

#define EASTL_DECLARE_HAS_VIRTUAL_DESTRUCTOR(T, hasVirtualDestructor) \
namespace eastl { \
template <> struct has_virtual_destructor<T> : public eastl::integral_constant<bool, hasVirtualDestructor> { }; \
Expand Down Expand Up @@ -1145,6 +1155,13 @@ namespace eastl



///////////////////////////////////////////////////////////////////////
// is_nothrow_default_constructible
///////////////////////////////////////////////////////////////////////
// TODO(rparolin): implement type-trait



///////////////////////////////////////////////////////////////////////
// is_copy_constructible
//
Expand Down Expand Up @@ -1512,11 +1529,10 @@ namespace eastl
template <> struct is_nothrow_assignable<const volatile T> : public eastl::integral_constant<bool, isNothrowAssignable> { }; \
}


#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T, class U>
EA_CONSTEXPR bool is_nothrow_assignable_v = is_nothrow_assignable<T, U>::value;
#endif
#endif



Expand Down Expand Up @@ -1641,6 +1657,10 @@ namespace eastl
: public eastl::is_trivially_assignable<typename eastl::add_lvalue_reference<T>::type,
typename eastl::add_rvalue_reference<T>::type> {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool is_trivially_move_assignable_v = is_trivially_move_assignable<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1880,6 +1900,11 @@ namespace eastl
template <> struct is_nothrow_destructible<const volatile T> { static const bool value = isNoThrowDestructible; }; \
}

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool is_nothrow_destructible_v = is_nothrow_destructible<T>::value;
#endif



///////////////////////////////////////////////////////////////////////
Expand All @@ -1892,6 +1917,10 @@ namespace eastl
struct is_nothrow_default_constructible
: public eastl::is_nothrow_constructible<T> {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool is_nothrow_default_constructible_v = is_nothrow_default_constructible<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
Expand Down
32 changes: 25 additions & 7 deletions include/EASTL/internal/type_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ namespace eastl
template <typename T>
struct is_signed : public eastl::is_signed_helper<typename eastl::remove_cv<T>::type>{};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool is_signed_v = is_signed<T>::value;
#endif

#define EASTL_DECLARE_SIGNED(T) \
namespace eastl{ \
Expand Down Expand Up @@ -177,6 +181,11 @@ namespace eastl
template <typename T>
struct is_unsigned : public eastl::is_unsigned_helper<typename eastl::remove_cv<T>::type>{};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR bool is_unsigned_v = is_unsigned<T>::value;
#endif

#define EASTL_DECLARE_UNSIGNED(T) \
namespace eastl{ \
template <> struct is_unsigned<T> : public true_type{}; \
Expand Down Expand Up @@ -255,6 +264,11 @@ namespace eastl
template<typename T, size_t N>
struct rank<T[N]> : public eastl::integral_constant<size_t, rank<T>::value + 1> {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
EA_CONSTEXPR auto rank_v = rank<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_base_of
Expand Down Expand Up @@ -295,21 +309,25 @@ namespace eastl
template<typename T> struct is_lvalue_reference : public eastl::false_type {};
template<typename T> struct is_lvalue_reference<T&> : public eastl::true_type {};

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_lvalue_reference_v = is_lvalue_reference<T>::value;
#endif


///////////////////////////////////////////////////////////////////////
// is_rvalue_reference
//
///////////////////////////////////////////////////////////////////////

#if EASTL_NO_RVALUE_REFERENCES
#define EASTL_TYPE_TRAIT_is_rvalue_reference_CONFORMANCE 0 // Given that the compiler doesn't support rvalue references, maybe the conformance here should be 1, since the result of this is always correct.
#define EASTL_TYPE_TRAIT_is_rvalue_reference_CONFORMANCE 1 // is_rvalue_reference is conforming.

template <typename T> struct is_rvalue_reference : public eastl::false_type {};
#else
#define EASTL_TYPE_TRAIT_is_rvalue_reference_CONFORMANCE 1 // is_rvalue_reference is conforming.
template <typename T> struct is_rvalue_reference : public eastl::false_type {};
template <typename T> struct is_rvalue_reference<T&&> : public eastl::true_type {};

template <typename T> struct is_rvalue_reference : public eastl::false_type {};
template <typename T> struct is_rvalue_reference<T&&> : public eastl::true_type {};
#if EASTL_VARIABLE_TEMPLATES_ENABLED
template<typename T>
EA_CONSTEXPR bool is_rvalue_reference_v = is_rvalue_reference<T>::value;
#endif


Expand Down
10 changes: 10 additions & 0 deletions include/EASTL/internal/type_transformations.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ namespace eastl
#endif
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
using make_signed_t = typename make_signed<T>::type;
#endif


///////////////////////////////////////////////////////////////////////
// add_signed
Expand Down Expand Up @@ -222,6 +227,11 @@ namespace eastl
#endif
#endif

#if EASTL_VARIABLE_TEMPLATES_ENABLED
template <class T>
using make_unsigned_t = typename make_unsigned<T>::type;
#endif



///////////////////////////////////////////////////////////////////////
Expand Down
Loading

0 comments on commit 6089142

Please sign in to comment.