Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 //-----------------------------------------------------------------------------
2 // boost variant/detail/apply_visitor_delayed.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
6 // Copyright (c) 2002-2003
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_VARIANT_DETAIL_APPLY_VISITOR_DELAYED_HPP
14 #define BOOST_VARIANT_DETAIL_APPLY_VISITOR_DELAYED_HPP
16 #include "boost/variant/detail/generic_result_type.hpp"
18 #include "boost/variant/detail/apply_visitor_unary.hpp"
19 #include "boost/variant/detail/apply_visitor_binary.hpp"
23 //////////////////////////////////////////////////////////////////////////
24 // function template apply_visitor(visitor)
26 // Returns a function object, overloaded for unary and binary usage, that
27 // visits its arguments using visitor (or a copy of visitor) via
28 // * apply_visitor( visitor, [argument] )
29 // under unary invocation, or
30 // * apply_visitor( visitor, [argument1], [argument2] )
31 // under binary invocation.
33 // NOTE: Unlike other apply_visitor forms, the visitor object must be
34 // non-const; this prevents user from giving temporary, to disastrous
35 // effect (i.e., returned function object would have dead reference).
38 template <typename Visitor>
39 class apply_visitor_delayed_t
41 public: // visitor typedefs
43 typedef typename Visitor::result_type
46 private: // representation
52 explicit apply_visitor_delayed_t(Visitor& visitor)
57 public: // unary visitor interface
59 template <typename Visitable>
60 BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
61 operator()(Visitable& visitable)
63 return apply_visitor(visitor_, visitable);
66 public: // binary visitor interface
68 template <typename Visitable1, typename Visitable2>
69 BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(result_type)
70 operator()(Visitable1& visitable1, Visitable2& visitable2)
72 return apply_visitor(visitor_, visitable1, visitable2);
77 template <typename Visitor>
78 inline apply_visitor_delayed_t<Visitor> apply_visitor(Visitor& visitor)
80 return apply_visitor_delayed_t<Visitor>(visitor);
85 #endif // BOOST_VARIANT_DETAIL_APPLY_VISITOR_DELAYED_HPP