{"height":"190","version":"1.0","blog_url":"https://yohhoy.hatenadiary.jp/","width":"100%","title":"std::clamp","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20160326%2Fp1\" title=\"std::clamp - yohhoy\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"yohhoy","published":"2016-03-26 00:00:00","author_url":"https://blog.hatena.ne.jp/yohhoy/","categories":["C++","C++1z","Boost"],"description":"C++1z(C++17)\u6a19\u6e96\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u3001\u6307\u5b9a\u533a\u9593\u5185\u306b\u5024\u3092\u5236\u9650\u3059\u308bstd::clamp\u95a2\u6570\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u304c\u8ffd\u52a0\u3055\u308c\u308b\u3002*1 #include <algorithm> int b = std::clamp(3, 1, 6); // 3 int a = std::clamp(0, 1, 6); // 1(\u4e0b\u9650\u5024) int c = std::clamp(8, 1, 6); // 6(\u4e0a\u9650\u5024) \u540c\u69d8\u306e\u95a2\u6570\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306fBoost.Algorithm\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3082\u63d0\u4f9b\u3055\u308c\u308b\u3002 #include <boost/algorithm/clamp.hpp> int x = boost::algorithm::c\u2026","blog_title":"yohhoy\u306e\u65e5\u8a18","type":"rich","provider_name":"Hatena Blog","url":"https://yohhoy.hatenadiary.jp/entry/20160326/p1","image_url":null,"provider_url":"https://hatena.blog"}