summaryrefslogtreecommitdiffstats
path: root/contrib/src/boost/iterator/detail/enable_if.hpp
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-05-12 13:12:33 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-05-12 13:12:33 (GMT)
commitb62e7979600feee23dc7cdb61042a8fc7673122b (patch)
treef7351372f37979dd2d048e0b68a16a4cd3b2aadb /contrib/src/boost/iterator/detail/enable_if.hpp
parent1b11b310be61e51b3ac5ebb83f7c8a33aef3d6e8 (diff)
downloaduscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.zip
uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.tar.gz
uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.tar.bz2
Major Refactoring v2.0
Diffstat (limited to 'contrib/src/boost/iterator/detail/enable_if.hpp')
-rw-r--r--contrib/src/boost/iterator/detail/enable_if.hpp83
1 files changed, 83 insertions, 0 deletions
diff --git a/contrib/src/boost/iterator/detail/enable_if.hpp b/contrib/src/boost/iterator/detail/enable_if.hpp
new file mode 100644
index 0000000..071f5fe
--- /dev/null
+++ b/contrib/src/boost/iterator/detail/enable_if.hpp
@@ -0,0 +1,83 @@
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// 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_ENABLE_IF_23022003THW_HPP
+#define BOOST_ENABLE_IF_23022003THW_HPP
+
+#include <boost/detail/workaround.hpp>
+#include <boost/mpl/identity.hpp>
+
+#include <boost/iterator/detail/config_def.hpp>
+
+//
+// Boost iterators uses its own enable_if cause we need
+// special semantics for deficient compilers.
+// 23/02/03 thw
+//
+
+namespace boost
+{
+
+ namespace iterators
+ {
+ //
+ // Base machinery for all kinds of enable if
+ //
+ template<bool>
+ struct enabled
+ {
+ template<typename T>
+ struct base
+ {
+ typedef T type;
+ };
+ };
+
+ //
+ // For compilers that don't support "Substitution Failure Is Not An Error"
+ // enable_if falls back to always enabled. See comments
+ // on operator implementation for consequences.
+ //
+ template<>
+ struct enabled<false>
+ {
+ template<typename T>
+ struct base
+ {
+#ifdef BOOST_NO_SFINAE
+
+ typedef T type;
+
+ // This way to do it would give a nice error message containing
+ // invalid overload, but has the big disadvantage that
+ // there is no reference to user code in the error message.
+ //
+ // struct invalid_overload;
+ // typedef invalid_overload type;
+ //
+#endif
+ };
+ };
+
+
+ template <class Cond,
+ class Return>
+ struct enable_if
+# if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE)
+ : enabled<(Cond::value)>::template base<Return>
+# else
+ : mpl::identity<Return>
+# endif
+ {
+ };
+
+ } // namespace iterators
+
+} // namespace boost
+
+#include <boost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ENABLE_IF_23022003THW_HPP