Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add is_number #188

Closed
gpeterhoff opened this issue Feb 4, 2024 · 3 comments
Closed

add is_number #188

gpeterhoff opened this issue Feb 4, 2024 · 3 comments

Comments

@gpeterhoff
Copy link

gpeterhoff commented Feb 4, 2024

is_number.hpp

//	Distributed under the Boost Software License Version 1.0 https://www.boost.org/LICENSE_1_0.txt
//	Copyright Gero Peterhoff

#ifndef BOOST_TYPE_TRAITS_IS_NUMBER_HPP
#define BOOST_TYPE_TRAITS_IS_NUMBER_HPP

#include <boost/type_traits/is_floating_point.hpp>
#include <boost/type_traits/is_integer.hpp>



namespace boost
{
template <typename Type>
struct is_number : public integral_constant
<
	bool,
	is_floating_point<Type>::value || is_integer<Type>::value
>	{};



#if !defined(BOOST_NO_CXX17_INLINE_VARIABLES)
template <typename Type> inline constexpr bool is_number_v = is_number<Type>::value;
#endif
}	//	boost

#endif	//	BOOST_TYPE_TRAITS_IS_NUMBER_HPP

@jzmaddock
Copy link
Collaborator

This is spelled is_arithmetic.

@gpeterhoff
Copy link
Author

gpeterhoff commented Feb 4, 2024

No! is_arithmetic contains characters and bool.

please open this issues.

@pdimov
Copy link
Member

pdimov commented Feb 5, 2024

If added should probably be is_numeric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants