1 // (C) Copyright David Abrahams 2002.
2 // (C) Copyright Jeremy Siek 2002.
3 // (C) Copyright Thomas Witt 2002.
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_ENABLE_IF_23022003THW_HPP
8 #define BOOST_ENABLE_IF_23022003THW_HPP
10 #include <boost/detail/workaround.hpp>
11 #include <boost/mpl/identity.hpp>
13 #include <boost/iterator/detail/config_def.hpp>
16 // Boost iterators uses its own enable_if cause we need
17 // special semantics for deficient compilers.
27 // Base machinery for all kinds of enable if
40 // For compilers that don't support "Substitution Failure Is Not An Error"
41 // enable_if falls back to always enabled. See comments
42 // on operator implementation for consequences.
50 #ifdef BOOST_NO_SFINAE
54 // This way to do it would give a nice error message containing
55 // invalid overload, but has the big disadvantage that
56 // there is no reference to user code in the error message.
58 // struct invalid_overload;
59 // typedef invalid_overload type;
69 # if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE)
70 : enabled<(Cond::value)>::template base<Return>
72 : mpl::identity<Return>
75 # if BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
80 } // namespace iterators
84 #include <boost/iterator/detail/config_undef.hpp>
86 #endif // BOOST_ENABLE_IF_23022003THW_HPP