diff options
author | chriseth <chris@ethereum.org> | 2018-10-02 16:52:53 +0800 |
---|---|---|
committer | chriseth <chris@ethereum.org> | 2018-10-09 20:27:21 +0800 |
commit | 3f216bac5e4ecd5723df815d13cae7ede4ad21dc (patch) | |
tree | 814b2f9d924bb7a63181c6d23ef20706510ff39e /libsolidity | |
parent | 547b26d46462663b49631d55cf32dc10094eb4d4 (diff) | |
download | dexon-solidity-3f216bac5e4ecd5723df815d13cae7ede4ad21dc.tar dexon-solidity-3f216bac5e4ecd5723df815d13cae7ede4ad21dc.tar.gz dexon-solidity-3f216bac5e4ecd5723df815d13cae7ede4ad21dc.tar.bz2 dexon-solidity-3f216bac5e4ecd5723df815d13cae7ede4ad21dc.tar.lz dexon-solidity-3f216bac5e4ecd5723df815d13cae7ede4ad21dc.tar.xz dexon-solidity-3f216bac5e4ecd5723df815d13cae7ede4ad21dc.tar.zst dexon-solidity-3f216bac5e4ecd5723df815d13cae7ede4ad21dc.zip |
Generic visitor.
Diffstat (limited to 'libsolidity')
-rw-r--r-- | libsolidity/inlineasm/AsmScope.h | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/libsolidity/inlineasm/AsmScope.h b/libsolidity/inlineasm/AsmScope.h index c8c63f8f..fc674e71 100644 --- a/libsolidity/inlineasm/AsmScope.h +++ b/libsolidity/inlineasm/AsmScope.h @@ -22,6 +22,8 @@ #include <libsolidity/interface/Exceptions.h> +#include <libdevcore/Visitor.h> + #include <boost/variant.hpp> #include <boost/optional.hpp> @@ -35,31 +37,6 @@ namespace solidity namespace assembly { -template <class...> -struct GenericVisitor{}; - -template <class Visitable, class... Others> -struct GenericVisitor<Visitable, Others...>: public GenericVisitor<Others...> -{ - using GenericVisitor<Others...>::operator (); - explicit GenericVisitor( - std::function<void(Visitable&)> _visitor, - std::function<void(Others&)>... _otherVisitors - ): - GenericVisitor<Others...>(_otherVisitors...), - m_visitor(_visitor) - {} - - void operator()(Visitable& _v) const { m_visitor(_v); } - - std::function<void(Visitable&)> m_visitor; -}; -template <> -struct GenericVisitor<>: public boost::static_visitor<> { - void operator()() const {} -}; - - struct Scope { using YulType = std::string; |