Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Changes
Page history
Update cpp
authored
Apr 20, 2024
by
umaumax
Show whitespace changes
Inline
Side-by-side
cpp.md
View page @
45a3c700
...
@@ -758,10 +758,12 @@ int main(int argc, char* argv[]) {
...
@@ -758,10 +758,12 @@ int main(int argc, char* argv[]) {
### [俺のunordered\_mapがこんなにpair型をキーにできないわけがない \- Qiita]( https://qiita.com/ganyariya/items/df35d253726269bda436 )
### [俺のunordered\_mapがこんなにpair型をキーにできないわけがない \- Qiita]( https://qiita.com/ganyariya/items/df35d253726269bda436 )
`ハッシュ可能`
である必要がある(第3項目に自作ハッシュ関数を定義すれば良い)
`ハッシュ可能`
である必要がある(第3項目に自作ハッシュ関数を定義すれば良い)
## `std::stol`
##
文字列からの数値変換 -
`std::stol`
*
c++
*
c++
*
[
stol - cpprefjp C++日本語リファレンス
](
https://cpprefjp.github.io/reference/string/stol.html
)
*
[
stol - cpprefjp C++日本語リファレンス
](
https://cpprefjp.github.io/reference/string/stol.html
)
*
例外を投げる
*
例外を投げる
*
> パラメータ idx が非 nullptr の場合、変換に使用されなかった要素のインデックス( end - str.c_str() )が格納される。
*
先頭が数字であれば例外は投げないため、この引数を指定することで、与えた文字列がすべて適切に利用されたかどうかを判定できる
*
c
*
c
*
[
Man page of STRTOL
](
https://linuxjm.osdn.jp/html/LDP_man-pages/man3/strtol.3.html
)
*
[
Man page of STRTOL
](
https://linuxjm.osdn.jp/html/LDP_man-pages/man3/strtol.3.html
)
*
例外を投げない
*
例外を投げない
...
...
...
...