Added macros for testing miniumum (0) andf maximum numbers.

This commit is contained in:
Edward Diener
2020-06-06 16:12:56 -04:00
parent a6c5cd5bcf
commit 43caf4d41e
7 changed files with 152 additions and 0 deletions

View File

@ -0,0 +1,27 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2020. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MAXIMUM_NUMBER_HPP
# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MAXIMUM_NUMBER_HPP
#
# /* BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER */
#
# include <boost/preprocessor/arithmetic/detail/maximum_number.hpp>
#
# if BOOST_PP_DETAIL_MAXIMUM_NUMBER == 256
# include <boost/preprocessor/arithmetic/detail/limits/is_maximum_number_256.hpp>
# elif BOOST_PP_DETAIL_MAXIMUM_NUMBER == 512
# include <boost/preprocessor/arithmetic/detail/limits/is_maximum_number_512.hpp>
# else
# error Incorrect value for the BOOST_PP_LIMIT_MAG limit
# endif
#
# endif

View File

@ -0,0 +1,21 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2020. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MINIMUM_NUMBER_HPP
# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MINIMUM_NUMBER_HPP
#
# /* BOOST_PP_DETAIL_IS_MINIMUM_NUMBER */
#
# include <boost/preprocessor/logical/not.hpp>
#
# define BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x) BOOST_PP_NOT(x)
#
# endif

View File

@ -0,0 +1,22 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2020. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MINMAX_NUMBER_HPP
# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MINMAX_NUMBER_HPP
#
# /* BOOST_PP_DETAIL_IS_MINMAX_NUMBER */
#
# include <boost/preprocessor/arithmetic/detail/is_minimum_number.hpp>
# include <boost/preprocessor/arithmetic/detail/is_maximum_number.hpp>
#
# define BOOST_PP_DETAIL_IS_MINMAX_NUMBER(x) (BOOST_PP_DETAIL_IS_MINIMUM_NUMBER(x),BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER(x))
#
# endif

View File

@ -0,0 +1,21 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2020. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MINMAX_BOTH_NUMBER_HPP
# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MINMAX_BOTH_NUMBER_HPP
#
# /* BOOST_PP_DETAIL_IS_MINMAX_BOTH_NUMBER */
#
# include <boost/preprocessor/arithmetic/detail/is_minmax.hpp>
#
# define BOOST_PP_DETAIL_IS_MINMAX_BOTH_NUMBER(x,y) (BOOST_PP_DETAIL_IS_MINMAX_NUMBER(x),BOOST_PP_DETAIL_IS_MINMAX_NUMBER(y))
#
# endif

View File

@ -0,0 +1,21 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2020. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MAXIMUM_NUMBER_256_HPP
# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MAXIMUM_NUMBER_256_HPP
#
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/facilities/is_empty.hpp>
#
# define BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER(x) BOOST_PP_IS_EMPTY(BOOST_PP_CAT(BOOST_PP_IS_256_HELPER_, x))
# define BOOST_PP_IS_256_HELPER_256
#
# endif

View File

@ -0,0 +1,21 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2020. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MAXIMUM_NUMBER_512_HPP
# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_IS_MAXIMUM_NUMBER_512_HPP
#
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/facilities/is_empty.hpp>
#
# define BOOST_PP_DETAIL_IS_MAXIMUM_NUMBER(x) BOOST_PP_IS_EMPTY(BOOST_PP_CAT(BOOST_PP_IS_512_HELPER_, x))
# define BOOST_PP_IS_512_HELPER_512
#
# endif

View File

@ -0,0 +1,19 @@
# /* **************************************************************************
# * *
# * (C) Copyright Edward Diener 2020. *
# * Distributed under the Boost Software License, Version 1.0. (See *
# * accompanying file LICENSE_1_0.txt or copy at *
# * http://www.boost.org/LICENSE_1_0.txt) *
# * *
# ************************************************************************** */
#
# /* See http://www.boost.org for most recent version. */
#
# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_MAXIMUM_NUMBER_HPP
# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_MAXIMUM_NUMBER_HPP
#
# include <boost/preprocessor/config/limits.hpp>
#
# define BOOST_PP_DETAIL_MAXIMUM_NUMBER BOOST_PP_LIMIT_MAG
#
# endif