xmasked_value_meta.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /***************************************************************************
  2. * Copyright (c) Johan Mabille, Sylvain Corlay, Wolf Vollprecht and *
  3. * Martin Renou *
  4. * Copyright (c) QuantStack *
  5. * *
  6. * Distributed under the terms of the BSD 3-Clause License. *
  7. * *
  8. * The full license is in the file LICENSE, distributed with this software. *
  9. ****************************************************************************/
  10. #ifndef XTL_XMASKED_VALUE_META_HPP
  11. #define XTL_XMASKED_VALUE_META_HPP
  12. #include <type_traits>
  13. namespace xtl
  14. {
  15. template <class T, class B = bool>
  16. class xmasked_value;
  17. namespace detail
  18. {
  19. template <class E>
  20. struct is_xmasked_value_impl : std::false_type
  21. {
  22. };
  23. template <class T, class B>
  24. struct is_xmasked_value_impl<xmasked_value<T, B>> : std::true_type
  25. {
  26. };
  27. }
  28. template <class E>
  29. using is_xmasked_value = detail::is_xmasked_value_impl<E>;
  30. template <class E, class R>
  31. using disable_xmasked_value = std::enable_if_t<!is_xmasked_value<E>::value, R>;
  32. }
  33. #endif