「やりたいこと → 書き方」の逆引き。キーワード検索 + カテゴリ絞り込み対応。開発中のカンペとしてブックマーク推奨。
s += other;s.c_str()s.substr(start, len);size_t p = s.find("abc"); if (p != npos) ...std::reverse(s.begin(), s.end());std::to_string(42);int n = std::stoi(s);std::istringstream is(s); for(string t; getline(is,t,',');)std::vector<int> v{1,2,3};std::vector<int> v(10, 0); // 10 個の 0v.push_back(x); v.emplace_back(args...);v.pop_back();v.erase(std::remove_if(v.begin(),v.end(),pred), v.end());v.size(), v.empty()for (auto& x : v) { ... }v.clear();v.resize(20);v.reserve(1000);std::map<std::string,int> m;m["key"] = 42;if (m.count("k")) ... // または m.contains (C++20)std::unordered_map<K,V> (hash map)s.insert(3);for (auto& [k,v] : m) { ... }auto f = [](int x){ return x*2; };[y](int x){ return x+y; }[&y](int x){ y += x; }[=]{...} / [&]{...}[y]() mutable { y++; return y; }std::function<int(int)> f = [](int x){return x;};std::sort(v.begin(), v.end());std::sort(v.begin(), v.end(), std::greater<>{});auto it = std::find(v.begin(), v.end(), x);std::find_if(v.begin(), v.end(), pred);std::count_if(v.begin(), v.end(), pred);std::accumulate(v.begin(), v.end(), 0LL);std::transform(in.begin(), in.end(), out.begin(), f);std::binary_search(v.begin(), v.end(), x);auto [mn,mx] = std::minmax_element(v.begin(), v.end());std::string l; std::getline(std::cin, l);std::ifstream f(p); for(std::string l; std::getline(f,l);) ...std::ofstream o(p); o << "hi\n";#include <iomanip> cout << std::fixed << std::setprecision(2) << x;auto p = std::make_unique<T>(args...);auto p = std::make_shared<T>(args...);auto q = std::move(p);T* raw = p.get();auto [a, b] = getPair();std::optional<int> x = 42; if (x) use(*x);std::variant<int,string> v; std::visit(visitor, v);if (auto it = m.find(k); it != m.end()) ...for (const auto& x : v) { ... }auto f(int x) { return x*2; }constexpr int sq(int x) { return x*x; }std::thread t([]{...}); t.join();