/*! @file Forward declares `boost::hana::integral_constant`. @copyright Louis Dionne 2013-2017 Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt) */ #ifndef BOOST_HANA_FWD_INTEGRAL_CONSTANT_HPP #define BOOST_HANA_FWD_INTEGRAL_CONSTANT_HPP #include #include #include BOOST_HANA_NAMESPACE_BEGIN //! Creates an `integral_constant` holding the given compile-time value. //! @relates hana::integral_constant //! //! Specifically, `integral_c` is a `hana::integral_constant` //! holding the compile-time value `v` of an integral type `T`. //! //! //! @tparam T //! The type of the value to hold in the `integral_constant`. //! It must be an integral type. //! //! @tparam v //! The integral value to hold in the `integral_constant`. //! //! //! Example //! ------- //! @snippet example/integral_constant.cpp integral_c template constexpr integral_constant integral_c{}; //! @relates hana::integral_constant template using bool_ = integral_constant; //! @relates hana::integral_constant template constexpr bool_ bool_c{}; //! @relates hana::integral_constant using true_ = bool_; //! @relates hana::integral_constant constexpr auto true_c = bool_c; //! @relates hana::integral_constant using false_ = bool_; //! @relates hana::integral_constant constexpr auto false_c = bool_c; //! @relates hana::integral_constant template using char_ = integral_constant; //! @relates hana::integral_constant template constexpr char_ char_c{}; //! @relates hana::integral_constant template using short_ = integral_constant; //! @relates hana::integral_constant template constexpr short_ short_c{}; //! @relates hana::integral_constant template using ushort_ = integral_constant; //! @relates hana::integral_constant template constexpr ushort_ ushort_c{}; //! @relates hana::integral_constant template using int_ = integral_constant; //! @relates hana::integral_constant template constexpr int_ int_c{}; //! @relates hana::integral_constant template using uint = integral_constant; //! @relates hana::integral_constant template constexpr uint uint_c{}; //! @relates hana::integral_constant template using long_ = integral_constant; //! @relates hana::integral_constant template constexpr long_ long_c{}; //! @relates hana::integral_constant template using ulong = integral_constant; //! @relates hana::integral_constant template constexpr ulong ulong_c{}; //! @relates hana::integral_constant template using llong = integral_constant; //! @relates hana::integral_constant template constexpr llong llong_c{}; //! @relates hana::integral_constant template using ullong = integral_constant; //! @relates hana::integral_constant template constexpr ullong ullong_c{}; //! @relates hana::integral_constant template using size_t = integral_constant; //! @relates hana::integral_constant template constexpr size_t size_c{}; namespace literals { //! Creates a `hana::integral_constant` from a literal. //! @relatesalso boost::hana::integral_constant //! //! The literal is parsed at compile-time and the result is returned //! as a `llong<...>`. //! //! @note //! We use `llong<...>` instead of `ullong<...>` because using an //! unsigned type leads to unexpected behavior when doing stuff like //! `-1_c`. If we used an unsigned type, `-1_c` would be something //! like `ullong<-1>` which is actually `ullong`. //! //! //! Example //! ------- //! @snippet example/integral_constant.cpp literals template constexpr auto operator"" _c(); } BOOST_HANA_NAMESPACE_END #endif // !BOOST_HANA_FWD_INTEGRAL_CONSTANT_HPP