summaryrefslogtreecommitdiffstats
path: root/ext/boost/concept/detail/has_constraints.hpp
diff options
context:
space:
mode:
authorJelte Jansen <jelte@isc.org>2009-10-30 18:19:48 +0100
committerJelte Jansen <jelte@isc.org>2009-10-30 18:19:48 +0100
commit24445dcc33ab8837cc4e34e318d2b7dcb27294ee (patch)
tree120efccf24731e5d57027ce3407dd0f9e0782125 /ext/boost/concept/detail/has_constraints.hpp
parentAdd command "boss shutdown" (diff)
downloadkea-24445dcc33ab8837cc4e34e318d2b7dcb27294ee.tar.xz
kea-24445dcc33ab8837cc4e34e318d2b7dcb27294ee.zip
update boost import script; added missing library parts
git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@231 e5f2f494-b856-4b98-b285-d166d9295462
Diffstat (limited to 'ext/boost/concept/detail/has_constraints.hpp')
-rw-r--r--ext/boost/concept/detail/has_constraints.hpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/ext/boost/concept/detail/has_constraints.hpp b/ext/boost/concept/detail/has_constraints.hpp
new file mode 100644
index 0000000000..3112b55514
--- /dev/null
+++ b/ext/boost/concept/detail/has_constraints.hpp
@@ -0,0 +1,48 @@
+// Copyright David Abrahams 2006. Distributed under the Boost
+// Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+#ifndef BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
+# define BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
+
+# include <boost/mpl/bool.hpp>
+# include <boost/detail/workaround.hpp>
+namespace boost { namespace concept {
+
+namespace detail
+{
+
+// Here we implement the metafunction that detects whether a
+// constraints metafunction exists
+ typedef char yes;
+ typedef char (&no)[2];
+
+ template <class Model, void (Model::*)()>
+ struct wrap_constraints {};
+
+#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580)
+ // Work around the following bogus error in Sun Studio 11, by
+ // turning off the has_constraints function entirely:
+ // Error: complex expression not allowed in dependent template
+ // argument expression
+ inline no has_constraints_(...);
+#else
+ template <class Model>
+ inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
+ inline no has_constraints_(...);
+#endif
+}
+
+// This would be called "detail::has_constraints," but it has a strong
+// tendency to show up in error messages.
+template <class Model>
+struct not_satisfied
+{
+ BOOST_STATIC_CONSTANT(
+ bool
+ , value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
+ typedef mpl::bool_<value> type;
+};
+
+}} // namespace boost::concept::detail
+
+#endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP