Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Compile-time header-only char implementation checking for C++03/11/14/17/20

License

NotificationsYou must be signed in to change notification settings

igozdev/charimpl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

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

licensereleasegodbolt

Example

#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


[8]ページ先頭

©2009-2025 Movatter.jp