Publishing R3
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / common / boost / 1.64.0 / include / boost-1_64 / boost / fusion / sequence / io / detail / out.hpp
1 /*=============================================================================
2     Copyright (c) 1999-2003 Jaakko Jarvi
3     Copyright (c) 1999-2003 Jeremiah Willcock
4     Copyright (c) 2001-2011 Joel de Guzman
5
6     Distributed under the Boost Software License, Version 1.0. (See accompanying 
7     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 ==============================================================================*/
9 #if !defined(FUSION_OUT_05052005_0121)
10 #define FUSION_OUT_05052005_0121
11
12 #include <boost/fusion/support/config.hpp>
13 #include <ostream>
14 #include <boost/fusion/sequence/io/detail/manip.hpp>
15
16 #include <boost/mpl/bool.hpp>
17 #include <boost/fusion/sequence/intrinsic/begin.hpp>
18 #include <boost/fusion/sequence/intrinsic/end.hpp>
19 #include <boost/fusion/iterator/deref.hpp>
20 #include <boost/fusion/iterator/next.hpp>
21 #include <boost/fusion/iterator/equal_to.hpp>
22
23 namespace boost { namespace fusion { namespace detail
24 {
25     template <typename Tag>
26     struct delimiter_out
27     {
28         // print a delimiter
29         template <typename OS>
30         static void
31         print(OS& os, char const* delim, mpl::false_ = mpl::false_())
32         {
33             detail::string_ios_manip<Tag, OS> manip(os);
34             manip.print(delim);
35         }
36
37         template <typename OS>
38         static void
39         print(OS&, char const*, mpl::true_)
40         {
41         }
42     };
43
44     struct print_sequence_loop
45     {
46         template <typename OS, typename First, typename Last>
47         static void
48         call(OS&, First const&, Last const&, mpl::true_)
49         {
50         }
51
52         template <typename OS, typename First, typename Last>
53         static void
54         call(OS& os, First const& first, Last const& last, mpl::false_)
55         {
56             result_of::equal_to<
57                 typename result_of::next<First>::type
58               , Last
59             >
60             is_last;
61
62             os << *first;
63             delimiter_out<tuple_delimiter_tag>::print(os, " ", is_last);
64             call(os, fusion::next(first), last, is_last);
65         }
66
67         template <typename OS, typename First, typename Last>
68         static void
69         call(OS& os, First const& first, Last const& last)
70         {
71             result_of::equal_to<First, Last> eq;
72             call(os, first, last, eq);
73         }
74     };
75
76     template <typename OS, typename Sequence>
77     inline void
78     print_sequence(OS& os, Sequence const& seq)
79     {
80         delimiter_out<tuple_open_tag>::print(os, "(");
81         print_sequence_loop::call(os, fusion::begin(seq), fusion::end(seq));
82         delimiter_out<tuple_close_tag>::print(os, ")");
83     }
84 }}}
85
86 #endif