From ccf575556a5d167f128a7ff8e817af7f9f3630ed Mon Sep 17 00:00:00 2001 From: wushin Date: Mon, 27 Apr 2015 17:16:03 -0500 Subject: Fix T Sub in a return-statement --- src/ints/wrap.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/ints/wrap.hpp') diff --git a/src/ints/wrap.hpp b/src/ints/wrap.hpp index 707c787..25b03c1 100644 --- a/src/ints/wrap.hpp +++ b/src/ints/wrap.hpp @@ -63,6 +63,14 @@ namespace ints return l._value < r._value; } + template + struct Sub : T + { + constexpr + Sub(typename T::wrapped_type v2) + : T(v2) + {} + }; template constexpr typename T::wrapped_type unwrap(typename std::enable_if::type w) @@ -73,14 +81,7 @@ namespace ints constexpr T wrap(typename T::wrapped_type v) { - struct Sub : T - { - constexpr - Sub(typename T::wrapped_type v2) - : T(v2) - {} - }; - return Sub(v); + return Sub(v); } template -- cgit v1.2.3-70-g09d2