|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /*!
- * \file /utl/concepts/defines.h
- * \brief Concepts defines
- *
- * 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_concepts_defines_h__
- #define __utl_concepts_defines_h__
-
- //!\defgroup concepts
- //!@{
-
- /*!
- * \brief
- * utl typename constraints wrapper
- *
- * \example
- * \code
- * template <utlConstrainType(SomeConcept) T> struct lala { };
- * // will expand to something like:
- * // template <SomeConcept T> struct lala { };
- * // or
- * // template <typename T> struct lala { };
- * \endcode
- */
- #if CXX_CONCEPTS
- #define utlConstrainType(_Concept_) _Concept_
- #else
- #define utlConstrainType(_Concept_) typename
- #endif
-
- /*! \brief
- * utl concept keyword syntax wrapper
- */
- #if CXX_CONCEPTS
- #if __cpp_concepts <= 201507L
- #define _utlConcept concept bool
- #else
- #define _utlConcept concept
- #endif
- #else
- #define _utlConcept constexpr bool
- #endif
-
- #ifndef CXX_LIB_INVOKE
- #ifdef __cpp_lib_invoke
- #define CXX_LIB_INVOKE __cpp_lib_invoke
- #else
- #define CXX_LIB_INVOKE 0
- #endif
- #endif
-
- //! @}
-
- #endif /* __utl_concepts_defines_h__ */
|