Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/spirit/home/support/attributes.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
200 | 200 |
201 template <typename T, typename Expected> | 201 template <typename T, typename Expected> |
202 struct is_weak_substitute<T, optional<Expected> > | 202 struct is_weak_substitute<T, optional<Expected> > |
203 : is_weak_substitute<T, Expected> {}; | 203 : is_weak_substitute<T, Expected> {}; |
204 | 204 |
205 #if !defined(BOOST_VARIANT_DO_NOT_USE_VARIADIC_TEMPLATES) | |
206 template <typename T, typename Expected> | |
207 struct is_weak_substitute<boost::variant<T>, Expected> | |
208 : is_weak_substitute<T, Expected> | |
209 {}; | |
210 | |
211 template <typename T0, typename T1, typename ...TN, typename Expected> | |
212 struct is_weak_substitute<boost::variant<T0, T1, TN...>, | |
213 Expected> | |
214 : mpl::bool_<is_weak_substitute<T0, Expected>::type::value && | |
215 is_weak_substitute<boost::variant<T1, TN...>, Expected>::type::value> | |
216 {}; | |
217 #else | |
205 #define BOOST_SPIRIT_IS_WEAK_SUBSTITUTE(z, N, _) \ | 218 #define BOOST_SPIRIT_IS_WEAK_SUBSTITUTE(z, N, _) \ |
206 is_weak_substitute<BOOST_PP_CAT(T, N), Expected>::type::value && \ | 219 is_weak_substitute<BOOST_PP_CAT(T, N), Expected>::type::value && \ |
207 /***/ | 220 /***/ |
208 | 221 |
209 // make sure unused variant parameters do not affect the outcome | 222 // make sure unused variant parameters do not affect the outcome |
218 : mpl::bool_<BOOST_PP_REPEAT(BOOST_VARIANT_LIMIT_TYPES | 231 : mpl::bool_<BOOST_PP_REPEAT(BOOST_VARIANT_LIMIT_TYPES |
219 , BOOST_SPIRIT_IS_WEAK_SUBSTITUTE, _) true> | 232 , BOOST_SPIRIT_IS_WEAK_SUBSTITUTE, _) true> |
220 {}; | 233 {}; |
221 | 234 |
222 #undef BOOST_SPIRIT_IS_WEAK_SUBSTITUTE | 235 #undef BOOST_SPIRIT_IS_WEAK_SUBSTITUTE |
236 #endif | |
223 | 237 |
224 template <typename T> | 238 template <typename T> |
225 struct is_weak_substitute<T, T | 239 struct is_weak_substitute<T, T |
226 , typename enable_if< | 240 , typename enable_if< |
227 mpl::and_<not_is_optional<T>, not_is_variant<T> > | 241 mpl::and_<not_is_optional<T>, not_is_variant<T> > |
514 | 528 |
515 static type call(optional<Attribute> const& val) | 529 static type call(optional<Attribute> const& val) |
516 { | 530 { |
517 if (!val) | 531 if (!val) |
518 return 0; | 532 return 0; |
519 return val.get(); | 533 return traits::size(val.get()); |
520 } | 534 } |
521 }; | 535 }; |
522 | 536 |
523 namespace detail | 537 namespace detail |
524 { | 538 { |