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