Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Przemo committed Jun 28, 2018
1 parent ee8ae96 commit dee98ee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.2.2)
project("owned_pointer" CXX)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall")
set(GMOCK_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/google-test/googlemock/include")
set(GTEST_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/google-test/googletest/include")

Expand Down
7 changes: 4 additions & 3 deletions inc/owned_pointer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ inline auto owned_pointer<R>::compare(const owned_pointer<T>& p) const noexcept
template<typename T>
auto owned_pointer<T>::stored_address() const noexcept -> element_type*
{
return base_type::operator bool() ?
return base_type::operator bool() ?
static_cast<element_type*>(_priv::ptr(base_type::operator*())) : nullptr;
}

Expand Down Expand Up @@ -385,10 +385,11 @@ constexpr bool is_expired_enabled_v{is_expired_enabled<T>::value};
template<typename T, typename = typename std::enable_if<_priv::is_expired_enabled<T>::value, void>::type>
inline bool is_expired_enabled_f(const owned_pointer<T>& p) noexcept
{
return p.expired() || dynamic_cast<_priv::shared_secret*>(p.operator->()) != nullptr;
return p.expired() || nullptr != dynamic_cast<_priv::shared_secret*>(p.operator->());
}

inline bool is_expired_enabled_f(...) noexcept
template<typename T>
inline bool is_expired_enabled_f(const T&) noexcept
{
return false;
}
Expand Down

0 comments on commit dee98ee

Please sign in to comment.