yohhoyの日記

技術的メモをしていきたい日記

2021-10-01から1ヶ月間の記事一覧

2進数フォーマット出力 in 標準C

プログラミング言語Cの次期C2x(C23)標準ライブラリprintf関数ファミリでは、変換指定子bによる2進数フォーマット出力がサポートされる。同時にscanf関数ファミリやstrtoT関数では0bプレフィクス付き文字列入力がサポートされる。*1 // C2x #include <stdio.h> printf(</stdio.h>…

自己再帰するラムダ式 @ C++23

次期C++2b(C++23)言語仕様に追加される Deducing this により、自己再帰するラムダ式を自然に記述できるようになる。ラムダ式の第1引数型this autoで宣言されるselfは explicit object parameter と呼ばれ、ここではラムダ式自身のクロージャ型(closure type…

OpenMP 最長コンストラクト

OpenMPの最長コンストラクト*1 Target Teams Distribute Parallel Worksharing-Loop SIMD Construct。 // OpenMP 4.0 for C/C++ #pragma omp target teams distribute parallel for simd /*for-loops*/ 関連URL OpenMP 4.0仕様リリース - yohhoyの日記 https…

typeof null == 'object'

バグは夜更け過ぎに仕様に変わるだろう*1 -- 詠人知らず // This stands since the beginning of JavaScript typeof null === 'object'; In the first implementation of JavaScript, JavaScript values were represented as a type tag and a value. The ty…