sl@0: // Boost enable_if library sl@0: sl@0: // Copyright 2003 © The Trustees of Indiana University. sl@0: sl@0: // Use, modification, and distribution is subject to the Boost Software sl@0: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at sl@0: // http://www.boost.org/LICENSE_1_0.txt) sl@0: sl@0: // Authors: Jaakko Järvi (jajarvi at osl.iu.edu) sl@0: // Jeremiah Willcock (jewillco at osl.iu.edu) sl@0: // Andrew Lumsdaine (lums at osl.iu.edu) sl@0: sl@0: sl@0: #ifndef BOOST_UTILITY_ENABLE_IF_HPP sl@0: #define BOOST_UTILITY_ENABLE_IF_HPP sl@0: sl@0: #include "boost/config.hpp" sl@0: sl@0: // Even the definition of enable_if causes problems on some compilers, sl@0: // so it's macroed out for all compilers that do not support SFINAE sl@0: sl@0: #ifndef BOOST_NO_SFINAE sl@0: sl@0: namespace boost sl@0: { sl@0: sl@0: template sl@0: struct enable_if_c { sl@0: typedef T type; sl@0: }; sl@0: sl@0: template sl@0: struct enable_if_c {}; sl@0: sl@0: template sl@0: struct enable_if : public enable_if_c {}; sl@0: sl@0: template sl@0: struct lazy_enable_if_c { sl@0: typedef typename T::type type; sl@0: }; sl@0: sl@0: template sl@0: struct lazy_enable_if_c {}; sl@0: sl@0: template sl@0: struct lazy_enable_if : public lazy_enable_if_c {}; sl@0: sl@0: sl@0: template sl@0: struct disable_if_c { sl@0: typedef T type; sl@0: }; sl@0: sl@0: template sl@0: struct disable_if_c {}; sl@0: sl@0: template sl@0: struct disable_if : public disable_if_c {}; sl@0: sl@0: template sl@0: struct lazy_disable_if_c { sl@0: typedef typename T::type type; sl@0: }; sl@0: sl@0: template sl@0: struct lazy_disable_if_c {}; sl@0: sl@0: template sl@0: struct lazy_disable_if : public lazy_disable_if_c {}; sl@0: sl@0: } // namespace boost sl@0: sl@0: #else sl@0: sl@0: namespace boost { sl@0: sl@0: namespace detail { typedef void enable_if_default_T; } sl@0: sl@0: template sl@0: struct enable_if_does_not_work_on_this_compiler; sl@0: sl@0: template sl@0: struct enable_if_c : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: template sl@0: struct disable_if_c : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: template sl@0: struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: template sl@0: struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: template sl@0: struct enable_if : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: template sl@0: struct disable_if : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: template sl@0: struct lazy_enable_if : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: template sl@0: struct lazy_disable_if : enable_if_does_not_work_on_this_compiler sl@0: { }; sl@0: sl@0: } // namespace boost sl@0: sl@0: #endif // BOOST_NO_SFINAE sl@0: sl@0: #endif