2
2
<feed xmlns =" http://www.w3.org/2005/Atom" >
3
3
<title >cpprefjp - C++日本語リファレンス</title >
4
4
<link href =" https://cpprefjp.github.io" />
5
- <updated >2025-07-05T13:37:48.266016 </updated >
6
- <id >381f238a-5cd7-4d31-8982-07414e8c1a9f </id >
5
+ <updated >2025-07-05T13:46:03.736074 </updated >
6
+ <id >6b4eb578-6b88-42be-9923-8709123f2d01 </id >
7
7
8
8
9
+ <entry >
10
+ <title >atof -- 不要スペースの削除</title >
11
+ <link href =" https://cpprefjp.github.io/reference/cstdlib/atof.html" />
12
+ <id >8c6d8f1b789e790ad0be54574c6f093c94cedafd:reference/cstdlib/atof.md</id >
13
+ <updated >2025-07-05T22:41:47+09:00</updated >
14
+
15
+ <summary type =" html" >< pre>< code> diff --git a/reference/cstdlib/atof.md b/reference/cstdlib/atof.md
16
+ index 5d0b3ee9d..d24063fdf 100644
17
+ --- a/reference/cstdlib/atof.md
18
+ +++ b/reference/cstdlib/atof.md
19
+ @@ -14,15 +14,10 @@ double atof( const char* str );
20
+ ## 変換方法
21
+
22
+ - 空白文字から始まる場合、最初の非空白文字から変換する。
23
+ -
24
+ - `0x` または `0X` の場合、空白でない16進数として処理する。
25
+ -
26
+ - `e`または`E`は、それより前を基数、その後ろを指数として処理する。
27
+ -
28
+ - \+ 、\-は変換後の符号に適用される。
29
+ -
30
+ - `INF`または`INFINITY`(大小文字区別せず)は`inf`を返す。
31
+ -
32
+ - NAN(大小文字区別せず)はそれ以前の数値を返す。もし以前の数値がないなら、`nan`を返す。
33
+
34
+
35
+ < /code>< /pre> </summary >
36
+
37
+ <author >
38
+ <name >K10-K10</name >
39
+
40
+ </author >
41
+ </entry >
42
+
43
+ <entry >
44
+ <title >atoi,atol,atoll -- cstdlib/atoi..:関連項目を追加</title >
45
+ <link href =" https://cpprefjp.github.io/reference/cstdlib/atoi_atol_atoll.html" />
46
+ <id >e10856ace4748d2c3c50081d5395093fe24ba701:reference/cstdlib/atoi_atol_atoll.md</id >
47
+ <updated >2025-07-05T22:40:22+09:00</updated >
48
+
49
+ <summary type =" html" >< pre>< code> diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md
50
+ index 638bfd6ac..fa38b9d6d 100644
51
+ --- a/reference/cstdlib/atoi_atol_atoll.md
52
+ +++ b/reference/cstdlib/atoi_atol_atoll.md
53
+ @@ -65,8 +65,14 @@ int main(void)
54
+ - Clang: ?
55
+ - GCC: 13[mark verified]
56
+ - ICC: ?
57
+ -- Visual C++
58
+ +- Visual C++ ?
59
+
60
+ +## 関連項目
61
+ +- [`stoi`](/reference/string/stoi.md)
62
+ +- [`stol`](/reference/string/stol.md)
63
+ +- [`stoll`](/reference/string/stoll.md)
64
+ +
65
+ +それぞれ`std::string` および `std::wstring` に対応させたものと見なせる。
66
+
67
+ ## 参照
68
+ - [7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf)
69
+ < /code>< /pre> </summary >
70
+
71
+ <author >
72
+ <name >K10-K10</name >
73
+
74
+ </author >
75
+ </entry >
76
+
9
77
<entry >
10
78
<title >cstdlib -- cstdlib.md:add path to atof.md</title >
11
79
<link href =" https://cpprefjp.github.io/reference/cstdlib.html" />
@@ -472,199 +540,4 @@ index 5cf9fef00..638bfd6ac 100644
472
540
</author >
473
541
</entry >
474
542
475
- <entry >
476
- <title >atoi,atol,atoll -- cstdlib/atoi..:add version</title >
477
- <link href =" https://cpprefjp.github.io/reference/cstdlib/atoi_atol_atoll.html" />
478
- <id >19b6ba2acab7b5b56c07f9c92dcd60f48b7bd7f2:reference/cstdlib/atoi_atol_atoll.md</id >
479
- <updated >2025-07-05T22:08:12+09:00</updated >
480
-
481
- <summary type =" html" >< pre>< code> diff --git a/reference/cstdlib/atoi_atol_atoll.md b/reference/cstdlib/atoi_atol_atoll.md
482
- index 7d31e88ec..5cf9fef00 100644
483
- --- a/reference/cstdlib/atoi_atol_atoll.md
484
- +++ b/reference/cstdlib/atoi_atol_atoll.md
485
- @@ -60,6 +60,14 @@ int main(void)
486
- -2147483648
487
- ```
488
-
489
- +## 処理系
490
- +### 処理系
491
- +- Clang: ?
492
- +- GCC: 13[mark verified]
493
- +- ICC: ?
494
- +- Visual C++
495
- +
496
- +
497
- ## 参照
498
- - [7.22.1.2 The atoi, atol, and atoll functions](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3220.pdf)
499
- - [7.22.1.2 The atoi, atol, and atoll functions (p: 249)](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2310.pdf)
500
- < /code>< /pre> </summary >
501
-
502
- <author >
503
- <name >K10-K10</name >
504
-
505
- </author >
506
- </entry >
507
-
508
- <entry >
509
- <title >charconv -- charconv:add path to atol</title >
510
- <link href =" https://cpprefjp.github.io/reference/charconv.html" />
511
- <id >3f1903d2f419b979d383ee58bbdcff339504f937:reference/charconv.md</id >
512
- <updated >2025-07-05T21:42:53+09:00</updated >
513
-
514
- <content type =" html" >< div class=" header">& lt;charconv& gt;< /div>< h1 itemprop=" name">< span class=" token"> charconv< /span>< span class=" cpp cpp17" title=" C++17で追加"> (C++17)< /span>< /h1>
515
- < div itemprop=" articleBody">< p>< code>& lt;charconv& gt;< /code> ヘッダでは、ロケール依存なし、フォーマット解析なしの高速な文字列・数値変換を提供する。< /p>
516
- < p> これらの変換は以下のような特徴がある。< /p>
517
- < ul>
518
- < li> フォーマットは引数で指定し、入力値のフォーマットを実行時に解析することはない< /li>
519
- < li> 動的にメモリ確保を行わない< /li>
520
- < li> ロケールを考慮しない(Cロケール (POSIXロケール) 固定)< /li>
521
- < li> バッファオーバーランしない< /li>
522
- < li> 例外を投げない(エラーは戻り値で表現、エラーと有効値は区別可能)< /li>
523
- < li> 使用可能なフォーマットは最小限< ul>
524
- < li> スペースが現れた場合はそこで変換終了< /li>
525
- < li> 浮動小数点数の指数部以外の< code> +< /code> 符号は考慮されない< /li>
526
- < li>< code> #< /code> による小数点以下の桁数指定はできない< /li>
527
- < li> 16進数に< code> 0x< /code> は付けられない< /li>
528
- < /ul>
529
- < /li>
530
- < /ul>
531
- < h2> 文字列 ⇔ 数値変換関数< /h2>
532
- < table border=" 1" bordercolor=" #888" style=" border-collapse:collapse">
533
- < thead>
534
- < tr>
535
- < th> 名前< /th>
536
- < th> 説明< /th>
537
- < th> 対応バージョン< /th>
538
- < /tr>
539
- < /thead>
540
- < tbody>
541
- < tr>
542
- < td>< code>< a href=" charconv/to_chars.html"> to_chars< /a>< /code>< /td>
543
- < td> 数値 → 文字列の変換< /td>
544
- < td> C++17< /td>
545
- < /tr>
546
- < tr>
547
- < td>< code>< a href=" charconv/from_chars.html"> from_chars< /a>< /code>< /td>
548
- < td> 文字列 → 数値の変換< /td>
549
- < td> C++17< /td>
550
- < /tr>
551
- < /tbody>
552
- < /table>
553
- < h2> クラス< /h2>
554
- < table border=" 1" bordercolor=" #888" style=" border-collapse:collapse">
555
- < thead>
556
- < tr>
557
- < th> 名前< /th>
558
- < th> 説明< /th>
559
- < th> 対応バージョン< /th>
560
- < /tr>
561
- < /thead>
562
- < tbody>
563
- < tr>
564
- < td>< code>< a href=" charconv/chars_format.html"> chars_format< /a>< /code>< /td>
565
- < td> 変換時の浮動小数点フォーマット指定のための列挙体< /td>
566
- < td> C++17< /td>
567
- < /tr>
568
- < tr>
569
- < td>< code>< a href=" charconv/to_chars_result.html"> to_chars_result< /a>< /code>< /td>
570
- < td>< code>< a href=" charconv/to_chars.html"> to_chars< /a>< /code> の結果型< /td>
571
- < td> C++17< /td>
572
- < /tr>
573
- < tr>
574
- < td>< code>< a href=" charconv/from_chars_result.html"> from_chars_result< /a>< /code>< /td>
575
- < td>< code>< a href=" charconv/from_chars.html"> from_chars< /a>< /code> の結果型< /td>
576
- < td> C++17< /td>
577
- < /tr>
578
- < /tbody>
579
- < /table>
580
- < h2> 導入された経緯< /h2>
581
- < p> XMLやJSONに代表されるテキストベースのデータを利用するケースが増えており、C++においてそれを利用するケースも増加している。
582
- それらは多くの場合コンピュータによって生成されコンピュータによって読まれるため国際化対応の必要がなく、生成する側でも読む側でもロケールに非依存であり、考慮するべきではない。< br />
583
- そして、これらのデータは多くの場合通信に利用されており高いスループットを要求される。< /p>
584
- < p> しかし、C++17未満の環境で利用可能であった文字列変換法はいずれもロケールに依存しておりロケール非依存な変換が提供されていなかったうえに、いずれの方法も動的なフォーマットの解析・指定や動的メモリ確保、エラー報告の不足等何かしら使いにくい所があった。< br />
585
- 動的なフォーマット解析はコンパイル時のフォーマットチェック及び選択を妨げ、(< code> iostream< /code> のマニピュレータのような)動的なフォーマット指定はその状態のスレッド間共有が必要になるため好ましくなく、動的メモリ確保を行わず変換エラーは区別できることが望ましい。< /p>
586
- < p> また、浮動小数点数を10進文字列→2進浮動小数点数→10進文字列と変換した時に最初と最後の文字列が一致する保証がある変換方法も提供されていなかった。< /p>
587
- < p> 各変換方法とその問題点< /p>
588
- < table border=" 1" bordercolor=" #888" style=" border-collapse:collapse">
589
- < thead>
590
- < tr>
591
- < th> 関数< /th>
592
- < th> 欠点< /th>
593
- < /tr>
594
- < /thead>
595
- < tbody>
596
- < tr>
597
- < td>< code> sprintf< /code>< /td>
598
- < td> ロケール依存、フォーマットの動的解析、バッファオーバーランの危険性< /td>
599
- < /tr>
600
- < tr>
601
- < td>< code> snprintf< /code>< /td>
602
- < td> ロケール依存、フォーマットの動的解析< /td>
603
- < /tr>
604
- < tr>
605
- < td>< code> sscanf< /code>< /td>
606
- < td> ロケール依存、フォーマットの動的解析< /td>
607
- < /tr>
608
- < tr>
609
- < td>< code>< a href=" cstdlib/atoi_atol_atoll.html"> atol< /a>< /code>< /td>
610
- < td> ロケール依存、エラー報告の不足< /td>
611
- < /tr>
612
- < tr>
613
- < td>< code> strtol< /code>< /td>
614
- < td> ロケール依存、先頭ホワイトスペースの無視、接頭辞(0x等)を考慮する< /td>
615
- < /tr>
616
- < tr>
617
- < td>< code> strstream< /code>< /td>
618
- < td> ロケール依存、先頭ホワイトスペースの無視< /td>
619
- < /tr>
620
- < tr>
621
- < td>< code> stringstream< /code>< /td>
622
- < td> ロケール依存、先頭ホワイトスペースの無視、動的メモリ確保< /td>
623
- < /tr>
624
- < tr>
625
- < td>< code> num_put / num_get facets< /code>< /td>
626
- < td> ロケール依存、仮想関数< /td>
627
- < /tr>
628
- < tr>
629
- < td>< code> to_string< /code>< /td>
630
- < td> ロケール依存、動的メモリ確保< /td>
631
- < /tr>
632
- < tr>
633
- < td>< code> stoi< /code> 等< /td>
634
- < td> ロケール依存、動的メモリ確保、先頭ホワイトスペースの無視、接頭辞(0x等)を考慮する、例外の送出< /td>
635
- < /tr>
636
- < /tbody>
637
- < /table>
638
- < p> これらの問題がなく高速な文字列・数値変換を提供するために、本ヘッダ及び< code> to_chars, from_chars< /code> 関数が導入された。各関数の特徴は冒頭及び個別のページを参照のこと。< /p>
639
- < h2> バージョン< /h2>
640
- < h3> 言語< /h3>
641
- < ul>
642
- < li> C++17< /li>
643
- < /ul>
644
- < h3> 処理系< /h3>
645
- < ul>
646
- < li>< a href=" ../implementation.html#clang"> Clang< /a> : 7.0(整数のみ) < span aria-label=" 検証済" role=" img" title=" 検証済"> ✅< /span> , 14.0(to_chars()のみ浮動小数点もsupport), 20.1(from_chars()もdouble, floatをsupport) < span aria-label=" 検証済" role=" img" title=" 検証済"> ✅< /span>< /li>
647
- < li>< a href=" ../implementation.html#gcc"> GCC< /a> : 8.0(整数のみ) < span aria-label=" 検証済" role=" img" title=" 検証済"> ✅< /span> , 11.1(full support) < span aria-label=" 検証済" role=" img" title=" 検証済"> ✅< /span>< /li>
648
- < li>< a href=" ../implementation.html#visual_cpp"> Visual C++< /a> : 2017 update 7(整数のみ) < span aria-label=" 検証済" role=" img" title=" 検証済"> ✅< /span> , update 9(full support) < span aria-label=" 検証済" role=" img" title=" 検証済"> ✅< /span>< /li>
649
- < /ul>
650
- < h2> 参照< /h2>
651
- < ul>
652
- < li>< a href=" https://faithandbrave.hateblo.jp/entry/2016/08/24/181540" target=" _blank"> C++1z ロケール依存なし、フォーマット解析なしの高速な文字列・数値変換 - Faith and Brave - C++で遊ぼう< /a>< /li>
653
- < li>< a href=" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0067r0.html" target=" _blank"> P0067R0 Elementary string conversions< /a>< /li>
654
- < li>< a href=" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0067r1.html" target=" _blank"> P0067R1 Elementary string conversions, revision 1< /a>< /li>
655
- < li>< a href=" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0067r2.html" target=" _blank"> P0067R2 Elementary string conversions, revision 2< /a>< /li>
656
- < li>< a href=" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0067r3.html" target=" _blank"> P0067R3 Elementary string conversions, revision 3< /a>< /li>
657
- < li>< a href=" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0067r4.html" target=" _blank"> P0067R4 Elementary string conversions, revision 4< /a>< /li>
658
- < li>< a href=" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0067r5.html" target=" _blank"> P0067R5 Elementary string conversions, revision 5< /a>< /li>
659
- < li>< a href=" http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0682r1.html" target=" _blank"> P0682R1: Repairing elementary string conversions< /a>< /li>
660
- < li>< a href=" http://open-std.org/JTC1/SC22/WG21/docs/papers/2015/n4412.html" target=" _blank"> N4412: Shortcomings of iostreams< /a>< /li>
661
- < li>< a href=" https://wg21.cmeerw.net/lwg/issue3080" target=" _blank"> LWG Issue 3080. Floating point from_chars pattern specification breaks round-tripping< /a>< /li>
662
- < /ul>< /div> </content >
663
-
664
- <author >
665
- <name >K10-K10</name >
666
-
667
- </author >
668
- </entry >
669
-
670
543
</feed >
0 commit comments