From 5d27fd83cfe0daa9800fd2b24a7d36cc394a1e4c Mon Sep 17 00:00:00 2001 From: Anton Bachin Date: Sat, 23 May 2015 10:10:24 -0500 Subject: [PATCH] Fixed incorrect definition of optional::operator ->. --- enum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enum.h b/enum.h index c5dfc55..ee295df 100644 --- a/enum.h +++ b/enum.h @@ -198,7 +198,7 @@ struct optional { _ENUM_CONSTEXPR optional(T v) : _valid(true), _value(v) { } _ENUM_CONSTEXPR const T& operator *() const { return _value; } - _ENUM_CONSTEXPR const T& operator ->() const { return _value; } + _ENUM_CONSTEXPR const T* operator ->() const { return &_value; } _ENUM_CONSTEXPR operator bool() const { return _valid; }