annotate DEPENDENCIES/generic/include/boost/spirit/home/qi/detail/construct.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2665513ce2d3
children
rev   line source
Chris@16 1 /*=============================================================================
Chris@16 2 Copyright (c) 2001-2011 Hartmut Kaiser
Chris@16 3 http://spirit.sourceforge.net/
Chris@16 4
Chris@16 5 Distributed under the Boost Software License, Version 1.0. (See accompanying
Chris@16 6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 7 =============================================================================*/
Chris@16 8 #if !defined(BOOST_SPIRIT_CONSTRUCT_MAR_24_2007_0629PM)
Chris@16 9 #define BOOST_SPIRIT_CONSTRUCT_MAR_24_2007_0629PM
Chris@16 10
Chris@16 11 #if defined(_MSC_VER)
Chris@16 12 #pragma once
Chris@16 13 #endif
Chris@16 14
Chris@16 15 #include <boost/config.hpp>
Chris@16 16 #include <boost/spirit/home/qi/parse.hpp>
Chris@16 17 #include <boost/spirit/home/support/common_terminals.hpp>
Chris@16 18 #include <boost/spirit/home/support/attributes_fwd.hpp>
Chris@16 19
Chris@16 20 namespace boost { namespace spirit { namespace traits
Chris@16 21 {
Chris@16 22 ///////////////////////////////////////////////////////////////////////////
Chris@16 23 // We provide overloads for the assign_to_attribute_from_iterators
Chris@16 24 // customization point for all built in types
Chris@16 25 ///////////////////////////////////////////////////////////////////////////
Chris@16 26 template <typename Iterator>
Chris@16 27 struct assign_to_attribute_from_iterators<char, Iterator>
Chris@16 28 {
Chris@16 29 static void
Chris@16 30 call(Iterator const& first, Iterator const&, char& attr)
Chris@16 31 {
Chris@16 32 attr = *first;
Chris@16 33 }
Chris@16 34 };
Chris@16 35
Chris@16 36 template <typename Iterator>
Chris@16 37 struct assign_to_attribute_from_iterators<signed char, Iterator>
Chris@16 38 {
Chris@16 39 static void
Chris@16 40 call(Iterator const& first, Iterator const&, signed char& attr)
Chris@16 41 {
Chris@16 42 attr = *first;
Chris@16 43 }
Chris@16 44 };
Chris@16 45
Chris@16 46 template <typename Iterator>
Chris@16 47 struct assign_to_attribute_from_iterators<unsigned char, Iterator>
Chris@16 48 {
Chris@16 49 static void
Chris@16 50 call(Iterator const& first, Iterator const&, unsigned char& attr)
Chris@16 51 {
Chris@16 52 attr = *first;
Chris@16 53 }
Chris@16 54 };
Chris@16 55
Chris@16 56 // wchar_t is intrinsic
Chris@16 57 template <typename Iterator>
Chris@16 58 struct assign_to_attribute_from_iterators<wchar_t, Iterator>
Chris@16 59 {
Chris@16 60 static void
Chris@16 61 call(Iterator const& first, Iterator const&, wchar_t& attr)
Chris@16 62 {
Chris@16 63 attr = *first;
Chris@16 64 }
Chris@16 65 };
Chris@16 66
Chris@16 67 #if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
Chris@16 68 // wchar_t is intrinsic, have separate overload for unsigned short
Chris@16 69 template <typename Iterator>
Chris@16 70 struct assign_to_attribute_from_iterators<unsigned short, Iterator>
Chris@16 71 {
Chris@16 72 static void
Chris@16 73 call(Iterator const& first, Iterator const&, unsigned short& attr)
Chris@16 74 {
Chris@16 75 attr = *first;
Chris@16 76 }
Chris@16 77 };
Chris@16 78 #endif
Chris@16 79
Chris@16 80 template <typename Iterator>
Chris@16 81 struct assign_to_attribute_from_iterators<bool, Iterator>
Chris@16 82 {
Chris@16 83 static void
Chris@16 84 call(Iterator const& first, Iterator const& last, bool& attr)
Chris@16 85 {
Chris@16 86 Iterator first_ = first;
Chris@16 87 qi::parse(first_, last, bool_type(), attr);
Chris@16 88 }
Chris@16 89 };
Chris@16 90
Chris@16 91 template <typename Iterator>
Chris@16 92 struct assign_to_attribute_from_iterators<short, Iterator>
Chris@16 93 {
Chris@16 94 static void
Chris@16 95 call(Iterator const& first, Iterator const& last, short& attr)
Chris@16 96 {
Chris@16 97 Iterator first_ = first;
Chris@16 98 qi::parse(first_, last, short_type(), attr);
Chris@16 99 }
Chris@16 100 };
Chris@16 101
Chris@16 102 template <typename Iterator>
Chris@16 103 struct assign_to_attribute_from_iterators<int, Iterator>
Chris@16 104 {
Chris@16 105 static void
Chris@16 106 call(Iterator const& first, Iterator const& last, int& attr)
Chris@16 107 {
Chris@16 108 Iterator first_ = first;
Chris@16 109 qi::parse(first_, last, int_type(), attr);
Chris@16 110 }
Chris@16 111 };
Chris@16 112 template <typename Iterator>
Chris@16 113 struct assign_to_attribute_from_iterators<unsigned int, Iterator>
Chris@16 114 {
Chris@16 115 static void
Chris@16 116 call(Iterator const& first, Iterator const& last, unsigned int& attr)
Chris@16 117 {
Chris@16 118 Iterator first_ = first;
Chris@16 119 qi::parse(first_, last, uint_type(), attr);
Chris@16 120 }
Chris@16 121 };
Chris@16 122
Chris@16 123 template <typename Iterator>
Chris@16 124 struct assign_to_attribute_from_iterators<long, Iterator>
Chris@16 125 {
Chris@16 126 static void
Chris@16 127 call(Iterator const& first, Iterator const& last, long& attr)
Chris@16 128 {
Chris@16 129 Iterator first_ = first;
Chris@16 130 qi::parse(first_, last, long_type(), attr);
Chris@16 131 }
Chris@16 132 };
Chris@16 133 template <typename Iterator>
Chris@16 134 struct assign_to_attribute_from_iterators<unsigned long, Iterator>
Chris@16 135 {
Chris@16 136 static void
Chris@16 137 call(Iterator const& first, Iterator const& last, unsigned long& attr)
Chris@16 138 {
Chris@16 139 Iterator first_ = first;
Chris@16 140 qi::parse(first_, last, ulong_type(), attr);
Chris@16 141 }
Chris@16 142 };
Chris@16 143
Chris@16 144 #ifdef BOOST_HAS_LONG_LONG
Chris@16 145 template <typename Iterator>
Chris@16 146 struct assign_to_attribute_from_iterators<long_long_type, Iterator>
Chris@16 147 {
Chris@16 148 static void
Chris@16 149 call(Iterator const& first, Iterator const& last, long_long_type& attr)
Chris@16 150 {
Chris@16 151 Iterator first_ = first;
Chris@16 152 qi::parse(first_, last, long_long_type(), attr);
Chris@16 153 }
Chris@16 154 };
Chris@16 155 template <typename Iterator>
Chris@16 156 struct assign_to_attribute_from_iterators<ulong_long_type, Iterator>
Chris@16 157 {
Chris@16 158 static void
Chris@16 159 call(Iterator const& first, Iterator const& last, ulong_long_type& attr)
Chris@16 160 {
Chris@16 161 Iterator first_ = first;
Chris@16 162 qi::parse(first_, last, ulong_long_type(), attr);
Chris@16 163 }
Chris@16 164 };
Chris@16 165 #endif
Chris@16 166
Chris@16 167 template <typename Iterator>
Chris@16 168 struct assign_to_attribute_from_iterators<float, Iterator>
Chris@16 169 {
Chris@16 170 static void
Chris@16 171 call(Iterator const& first, Iterator const& last, float& attr)
Chris@16 172 {
Chris@16 173 Iterator first_ = first;
Chris@16 174 qi::parse(first_, last, float_type(), attr);
Chris@16 175 }
Chris@16 176 };
Chris@16 177
Chris@16 178 template <typename Iterator>
Chris@16 179 struct assign_to_attribute_from_iterators<double, Iterator>
Chris@16 180 {
Chris@16 181 static void
Chris@16 182 call(Iterator const& first, Iterator const& last, double& attr)
Chris@16 183 {
Chris@16 184 Iterator first_ = first;
Chris@16 185 qi::parse(first_, last, double_type(), attr);
Chris@16 186 }
Chris@16 187 };
Chris@16 188
Chris@16 189 template <typename Iterator>
Chris@16 190 struct assign_to_attribute_from_iterators<long double, Iterator>
Chris@16 191 {
Chris@16 192 static void
Chris@16 193 call(Iterator const& first, Iterator const& last, long double& attr)
Chris@16 194 {
Chris@16 195 Iterator first_ = first;
Chris@16 196 qi::parse(first_, last, long_double_type(), attr);
Chris@16 197 }
Chris@16 198 };
Chris@16 199
Chris@16 200 }}}
Chris@16 201
Chris@16 202 #endif