From ddba92129a34f918ec183892b99328b19af31e71 Mon Sep 17 00:00:00 2001 From: Chris Beck Date: Sat, 13 Aug 2016 10:09:54 -0400 Subject: [PATCH] simplify some code related to variant::storage --- include/strict_variant/variant_storage.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/include/strict_variant/variant_storage.hpp b/include/strict_variant/variant_storage.hpp index 467cc4c..ee86135 100644 --- a/include/strict_variant/variant_storage.hpp +++ b/include/strict_variant/variant_storage.hpp @@ -80,19 +80,20 @@ struct storage { /*** * Typed access which pierces recursive_wrapper if detail::false_ is passed + * "Internal" (non-piercing) access is achieved if detail::true_ is passed */ - template - value_t & get_value(const Internal &) & { + template + value_t & get_value(const detail::true_ &) & { return *reinterpret_cast *>(this->address()); } - template - const value_t & get_value(const Internal &) const & { + template + const value_t & get_value(const detail::true_ &) const & { return *reinterpret_cast *>(this->address()); } - template - value_t && get_value(const Internal &) && { + template + value_t && get_value(const detail::true_ &) && { return std::move(*reinterpret_cast *>(this->address())); }