Micro template library A library for building device drivers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

57 lines
1.5 KiB

  1. /*!
  2. * \file void.h
  3. * \brief void_t meta-function
  4. *
  5. * Copyright (C) 2018 Christos Choutouridis
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU Lesser General Public License as
  9. * published by the Free Software Foundation, either version 3
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef __utl_meta_void_h__
  21. #define __utl_meta_void_h__
  22. #include <utl/core/impl.h>
  23. /*!
  24. * \ingroup meta
  25. * \defgroup void
  26. */
  27. //! @{
  28. namespace utl {
  29. namespace meta {
  30. /*!
  31. * void_t meta-function that maps a sequence of any types to the type void
  32. */
  33. //! @{
  34. #if defined(UTL_WORKAROUND_CWG_1558)
  35. template<typename... _Ts>
  36. struct void_ {
  37. using type = void;
  38. };
  39. //! void_t type alias
  40. template<typename... _Ts>
  41. using void_t = type_of<void_<_Ts...>>;
  42. #else
  43. //! void_ type alias
  44. template <typename...> using void_ = void;
  45. //! void_t type alias
  46. template <typename...> using void_t = void;
  47. #endif
  48. //! @}
  49. }}
  50. //!@}
  51. #endif /* __utl_meta_void_h__ */