1 /*=============================================================================
2 Copyright (c) 2001-2011 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #if !defined(FUSION_CONVERT_ITERATOR_05062005_1218)
8 #define FUSION_CONVERT_ITERATOR_05062005_1218
10 #include <boost/fusion/support/is_iterator.hpp>
11 #include <boost/mpl/if.hpp>
12 #include <boost/mpl/bool.hpp>
14 namespace boost { namespace fusion
16 template <typename Iterator>
17 struct mpl_iterator; // forward declaration
19 // Test T. If it is a fusion iterator, return a reference to it.
20 // else, assume it is an mpl iterator.
23 struct convert_iterator
34 call(T const& x, mpl::true_)
39 static mpl_iterator<T>
40 call(T const& /*x*/, mpl::false_)
42 return mpl_iterator<T>();
53 return call(x, is_fusion_iterator<T>());