From b83108c41a637079cc17ce03f62f9e68cf8207cc Mon Sep 17 00:00:00 2001 From: abitmore Date: Sat, 11 Aug 2018 11:18:55 -0400 Subject: [PATCH] Added static visit(...) methods to static_variant --- include/fc/static_variant.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/fc/static_variant.hpp b/include/fc/static_variant.hpp index 88efeda..45e781b 100644 --- a/include/fc/static_variant.hpp +++ b/include/fc/static_variant.hpp @@ -326,6 +326,16 @@ public: return impl::storage_ops<0, Types...>::apply(_tag, storage, v); } + template + static typename visitor::result_type visit(visitor& v) { + return impl::storage_ops<0, Types...>::apply((const tag_type)w, (const void*)nullptr, v); + } + + template + static typename visitor::result_type visit(const visitor& v) { + return impl::storage_ops<0, Types...>::apply((const tag_type)w, (const void*)nullptr, v); + } + static int count() { return impl::type_info::count; } void set_which( tag_type w ) { FC_ASSERT( w >= 0 );