From 80ca498d79296ac30499cd3ab017859ad3b191c4 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 28 Jan 2016 21:05:07 +0100 Subject: [PATCH] put variant predicate interface in non-anonymous namespace ...to avoid warnings when deriving a publicly visible type from that interface. Newer GCC and CLang versions emit warnings when details from an anonymous implementation namespace will leak into type signatures visible outside the translation unit. In this case here, it's the VTable. --- src/lib/variant.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/variant.hpp b/src/lib/variant.hpp index 75c57b1d6..d23ba8c50 100644 --- a/src/lib/variant.hpp +++ b/src/lib/variant.hpp @@ -102,7 +102,7 @@ namespace lib { namespace error = lumiera::error; - namespace { // implementation helpers + namespace variant { // implementation helpers using std::remove_reference; using meta::NullType; @@ -190,9 +190,9 @@ namespace lib { enum { SIZ = meta::maxSize::value }; template - using VisitorFunc = typename VFunc::template VisitorInterface; + using VisitorFunc = typename variant::VFunc::template VisitorInterface; template - using VisitorConstFunc = typename VFunc::template VisitorInterface>; + using VisitorConstFunc = typename variant::VFunc::template VisitorInterface>; /** * to be implemented by the client for visitation @@ -313,7 +313,7 @@ namespace lib { void dispatch (Visitor& visitor) { - using Dispatcher = VFunc::template ValueAcceptInterface; + using Dispatcher = variant::VFunc::template ValueAcceptInterface; Dispatcher& typeDispatcher = visitor; typeDispatcher.handle (this->access()); @@ -322,7 +322,7 @@ namespace lib { bool dispatch (Predicate& visitor) const { - using Dispatcher = VFunc::template ValueAcceptInterface; + using Dispatcher = variant::VFunc::template ValueAcceptInterface; Dispatcher& typeDispatcher = visitor; return typeDispatcher.handle (this->access()); @@ -392,7 +392,7 @@ namespace lib { template Variant(X&& x) { - using StorageType = typename CanBuildFrom::Type; + using StorageType = typename variant::CanBuildFrom::Type; new(storage_) Buff (forward(x)); } @@ -416,7 +416,7 @@ namespace lib { Variant& operator= (X x) { - using RawType = typename remove_reference::type; + using RawType = typename std::remove_reference::type; static_assert (meta::isInList(), "Type error: the given variant could never hold the required type"); static_assert (std::is_copy_assignable::value, "target type does not support assignment");