Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
bkaradzic committed Aug 27, 2022
1 parent dbafa14 commit 68dfd59
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions include/bx/bx.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@
namespace bx
{
/// Returns true if type `Ty` is trivially copyable / POD type.
template<class Ty>
template<typename Ty>
constexpr bool isTriviallyCopyable();

/// Find the address of an object of a class that has an overloaded unary ampersand (&) operator.
template <class Ty>
template<typename Ty>
Ty* addressOf(Ty& _a);

/// Find the address of an object of a class that has an overloaded unary ampersand (&) operator.
template <class Ty>
template<typename Ty>
const Ty* addressOf(const Ty& _a);

///
Expand Down
14 changes: 7 additions & 7 deletions include/bx/inline/bx.inl
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ namespace bx
return _x;
}

template<class Ty>
template<typename Ty>
inline constexpr bool isTriviallyCopyable()
{
return __is_trivially_copyable(Ty);
}

template<class Ty>
template<typename Ty>
inline Ty* addressOf(Ty& _a)
{
return reinterpret_cast<Ty*>(
Expand All @@ -43,7 +43,7 @@ namespace bx
);
}

template<class Ty>
template<typename Ty>
inline const Ty* addressOf(const Ty& _a)
{
return reinterpret_cast<const Ty*>(
Expand Down Expand Up @@ -71,20 +71,20 @@ namespace bx
Ty tmp = _a; _a = _b; _b = tmp;
}

template<class Ty>
template<typename Ty>
struct IsSignedT { static constexpr bool value = Ty(-1) < Ty(0); };

template<class Ty, bool SignT = IsSignedT<Ty>::value>
template<typename Ty, bool SignT = IsSignedT<Ty>::value>
struct Limits;

template<class Ty>
template<typename Ty>
struct Limits<Ty, true>
{
static constexpr Ty max = ( ( (Ty(1) << ( (sizeof(Ty) * 8) - 2) ) - Ty(1) ) << 1) | Ty(1);
static constexpr Ty min = -max - Ty(1);
};

template<class Ty>
template<typename Ty>
struct Limits<Ty, false>
{
static constexpr Ty min = 0;
Expand Down

0 comments on commit 68dfd59

Please sign in to comment.