|
- /*!
- * \file void_t.h
- * \brief Template meta-programming helpers
- *
- * Copyright (C) 2018 Christos Choutouridis
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
- #ifndef __utl_meta_void_t_h__
- #define __utl_meta_void_t_h__
-
- #include <utl/impl/version.h>
-
- //! \ingroup meta
- //! \defgroup void_t
- //! A void_t implementation for utl
- //! @{
- namespace utl {
-
- /*!
- * Utility meta-function that maps a sequence of any types to the type void
- * \note The idea is:
- * template <typename ...>
- * using void_t = void;
- *
- * Until CWG 1558 (a C++14 defect), unused parameters in alias templates were not
- * guaranteed to ensure SFINAE and could be ignored, so earlier compilers require
- * a more complex definition of void_t, such as the following implementation
- * https://en.cppreference.com
- */
- template<typename... _Ts>
- struct void_impl {
- typedef void type;
- };
- //! The actual void_t type alias
- template<typename... _Ts>
- using void_t = typename void_impl<_Ts...>::type;
- }
- //! @}
-
- #endif /* __utl_meta_void_t_h__ */
|