Skip to content

Commit

Permalink
Manually fix optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasz A.J. Wrona committed Sep 4, 2017
1 parent 43d0602 commit 4dbf939
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
7 changes: 3 additions & 4 deletions src/nonstd/optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ union storage_t
typedef struct { align_as_type data[ 1 + ( sizeof(value_type) - 1 ) / sizeof(align_as_type) ]; } aligned_storage_t;
aligned_storage_t data;

# undef optional_ALIGN_AS
#undef optional_ALIGN_AS

#endif // optional_CONFIG_MAX_ALIGN_HACK

Expand Down Expand Up @@ -735,8 +735,7 @@ class optional

optional_constexpr value_type const && operator *() const optional_refref_qual
{
assert( has_value() );
return std::move( contained.value() );
return assert( has_value() ), std::move( contained.value() );
}

optional_constexpr14 value_type && operator *() optional_refref_qual
Expand Down Expand Up @@ -1071,7 +1070,7 @@ using namespace optional_lite;
namespace std {

template< class T >
class hash< nonstd::optional<T> >
struct hash< nonstd::optional<T> >
{
public:
std::size_t operator()( nonstd::optional<T> const & v ) const optional_noexcept
Expand Down
12 changes: 0 additions & 12 deletions src/util/optional.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,19 @@
#if defined __clang__
#pragma clang diagnostic push ignore "-Wall"
#pragma clang diagnostic push ignore "-Wpedantic"
#pragma clang diagnostic push ignore "-Wunknown-pragmas"
#pragma clang diagnostic push ignore "-Wc++1y-extensions"
#pragma clang diagnostic push ignore "-Wc++14-extensions"
#elif defined __GNUC__
#pragma GCC diagnostic push ignore "-Wall"
#pragma GCC diagnostic push ignore "-Wpedantic"
#pragma GCC diagnostic push ignore "-Wunknown-pragmas"
#pragma GCC diagnostic push ignore "-Wc++1y-extensions"
#pragma GCC diagnostic push ignore "-Wc++14-extensions"
#elif defined _MSC_VER
#pragma warning(push)
#endif
#include <nonstd/optional.hpp>
#if defined __clang__
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#pragma clang diagnostic pop
#elif defined __GNUC__
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#pragma GCC diagnostic pop
#elif defined _MSC_VER
#pragma warning(pop)
#endif
Expand Down

0 comments on commit 4dbf939

Please sign in to comment.