Compile-time header-onlychar
implementation checking forC++03/11/14/17/20



#include<iostream>#include<charimpl/charimpl.hpp>intmain(){ std::cout << std::boolalpha <<charimpl::is_ascii() << std::endl <<charimpl::is_ebcdic() << std::endl <<charimpl::is_ebcdic037() << std::endl <<charimpl::is_ebcdic1047() << std::endl;}
All functions are marked as consteval/constexpr and noexcept if allowed by the compiler.
boolcharimpl::is_ascii();// Returns true if ASCII encoding is currently in use, false otherwiseboolcharimpl::is_ebcdic();// Returns true if any form of EBCDIC encoding is currently in use, false otherwiseboolcharimpl::is_ebcdic037();// Returns true if EBCDIC037/IBM037 encoding is currently in use, false otherwiseboolcharimpl::is_ebcdic273();// Returns true if EBCDIC273/IBM037 encoding is currently in use, false otherwiseboolcharimpl::is_ebcdic1047();// Returns true if EBCDIC1047/IBM1047 encoding is currently in use, false otherwise
CHARIMPL_ASCII_EXPR// Macro which expands to an expression equal to the result of charimpl::is_ascii()CHARIMPL_EBCDIC_EXPR// Macro which expands to an expression equal to the result of charimpl::is_ebcdic()CHARIMPL_EBCDIC037_EXPR// Macro which expands to an expression equal to the result of charimpl::is_ebcdic037()CHARIMPL_EBCDIC273_EXPR// Macro which expands to an expression equal to the result of charimpl::is_ebcdic273()CHARIMPL_EBCDIC1047_EXPR// Macro which expands to an expression equal to the result of charimpl::is_ebcdic1047()
Note: Macros should be surrounded with parentheses when used in larger statements in order to avoid potential issues with operator precedence