|
- /*!
- * \file detection.h
- * \brief Detection idiom based on WG21's N4502[1] from Walter E. Brown
- *
- * [1]: www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4502.pdf
- *
- * Copyright (C) 2018-2019 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_detection_h__
- #define __utl_meta_detection_h__
-
- #include <utl/core/impl.h>
- #include <utl/meta/logical.h>
- #include <type_traits>
-
- /*!
- * \ingroup meta
- * \defgroup detection
- * Detection idiom support header.
- */
- //! @{
-
- namespace utl {
- namespace meta {
-
- /*!
- * void_t meta-function that maps a sequence of any types to the type void
- */
- //! @{
- #if defined(UTL_WORKAROUND_CWG_1558)
- template<typename... _Ts>
- struct void_ {
- using type = void;
- };
- //! void_t type alias
- template<typename... _Ts>
- using void_t = eval<void_<_Ts...>>;
- #else
- //! void_ type alias
- template <typename...> using void_ = void;
- //! void_t type alias
- template <typename...> using void_t = void;
- #endif
- //! @}
- }}
- //!@}
-
- #endif /* __utl_meta_void_h__ */
|