Skip to content

Commit

Permalink
Remove POMDOG_CONSTEXPR_ASSERT macro
Browse files Browse the repository at this point in the history
  • Loading branch information
mogemimi committed Jan 27, 2018
1 parent 0c2f2d5 commit a6e898c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
18 changes: 0 additions & 18 deletions include/Pomdog/Utility/Assert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,5 @@ namespace Detail {
# define POMDOG_ASSERT_MESSAGE(expression, message)
#endif

#if defined(DEBUG)
namespace Assertion {

inline constexpr bool ConstexprAssert(bool condition)
{
return (assert(condition), condition);
}

} // namespace Assertion
# // Debug mode
# define POMDOG_CONSTEXPR_ASSERT(expression) \
static_cast<void>(Pomdog::Detail::Assertion::ConstexprAssert( \
static_cast<bool>(expression)))
#else
# // Release mode
# define POMDOG_CONSTEXPR_ASSERT(expression) static_cast<void const>(0)
#endif

} // namespace Detail
} // namespace Pomdog
9 changes: 6 additions & 3 deletions include/Pomdog/Utility/Optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class Optional final {

constexpr const T* operator->() const noexcept
{
return POMDOG_CONSTEXPR_ASSERT(valid), &data;
POMDOG_ASSERT(valid);
return &data;
}

T* operator->() noexcept
Expand All @@ -82,7 +83,8 @@ class Optional final {

constexpr const T& operator*() const
{
return POMDOG_CONSTEXPR_ASSERT(valid), data;
POMDOG_ASSERT(valid);
return data;
}

T & operator*()
Expand All @@ -98,7 +100,8 @@ class Optional final {

constexpr const T& value() const
{
return POMDOG_CONSTEXPR_ASSERT(valid), data;
POMDOG_ASSERT(valid);
return data;
}

T & value()
Expand Down

0 comments on commit a6e898c

Please sign in to comment.