Skip to content

add is_character #187

@gpeterhoff

Description

@gpeterhoff

is_character.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_CHARACTER_HPP
#define BOOST_TYPE_TRAITS_IS_CHARACTER_HPP

#include <boost/type_traits/integral_constant.hpp>
#include <boost/type_traits/remove_cvref.hpp>



namespace boost
{
template <typename Type> struct is_character				: public false_type{};
template <typename Type> struct is_character<volatile const Type>	: public is_character<Type>{};
template <typename Type> struct is_character<volatile Type>		: public is_character<Type>{};
template <typename Type> struct is_character<const Type>		: public is_character<Type>{};

#if defined(__cpp_unicode_characters)
template <> struct is_character<char32_t>	: public true_type{};
template <> struct is_character<char16_t>	: public true_type{};
#endif

#if defined(__cpp_char8_t)
template <> struct is_character<char8_t>	: public true_type{};
#endif

template <> struct is_character<wchar_t>	: public true_type{};
template <> struct is_character<char>		: public true_type{};



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

#endif	//	BOOST_TYPE_TRAITS_IS_CHARACTER_HPP

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions