enable_if.hpp 829 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. Copyright 2003 The Trustees of Indiana University
  3. Authors: Jaakko Jarvi (jajarvi at osl.iu.edu)
  4. Jeremiah Willcock (jewillco at osl.iu.edu)
  5. Andrew Lumsdaine (lums at osl.iu.edu)
  6. Copyright 2018 Glen Joseph Fernandes
  7. (glenjofe@gmail.com)
  8. Distributed under the Boost Software License,
  9. Version 1.0. (See accompanying file LICENSE_1_0.txt
  10. or copy at http://www.boost.org/LICENSE_1_0.txt)
  11. */
  12. #ifndef BOOST_TT_ENABLE_IF_HPP_INCLUDED
  13. #define BOOST_TT_ENABLE_IF_HPP_INCLUDED
  14. #include <boost/config.hpp>
  15. namespace boost {
  16. template<bool B, class T = void>
  17. struct enable_if_ {
  18. typedef T type;
  19. };
  20. template<class T>
  21. struct enable_if_<false, T> { };
  22. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  23. template<bool B, class T = void>
  24. using enable_if_t = typename enable_if_<B, T>::type;
  25. #endif
  26. } /* boost */
  27. #endif