{"id":60579,"library":"expected-lite","title":"expected-lite","description":"Expected objects in C++11 and later in a single-file header-only library.","status":"active","version":"0.10.0","language":"cpp","source_language":null,"source_url":null,"tags":["expected","error-handling","header-only","c++11"],"install":[{"cmd":"vcpkg install expected-lite","lang":"bash","label":"vcpkg"},{"cmd":"# CMakeLists.txt\nfind_package(expected_lite CONFIG REQUIRED)\ntarget_link_libraries(main PRIVATE expected-lite::expected-lite)","lang":"cmake","label":"CMake"}],"dependencies":[],"imports":[{"symbol":"nonstd/expected.hpp","correct":"#include <nonstd/expected.hpp>"}],"quickstart":{"code":"#include <nonstd/expected.hpp>\n#include <iostream>\n\nnonstd::expected<int, std::string> divide(int a, int b) {\n    if (b == 0) return nonstd::make_unexpected(\"division by zero\");\n    return a / b;\n}\n\nint main() {\n    auto result = divide(10, 2);\n    if (result) std::cout << *result << std::endl;\n    else std::cout << result.error() << std::endl;\n    return 0;\n}","lang":"cpp","description":"Use expected to handle division by zero without exceptions."},"warnings":[],"env_vars":null,"search_vec":"'+11':8,28 'c':7,27 'error':22 'error-handl':21 'expect':2,4,20 'expected-lit':1 'file':15 'handl':23 'header':17,25 'header-on':16,24 'later':10 'librari':19 'lite':3 'object':5 'singl':14 'single-fil':13","created_at":"2026-06-16T19:36:24.837234+00:00","updated_at":"2026-06-16T19:36:24.837234+00:00","problems":[],"ecosystem":"vcpkg","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-12-14","install_tag":null}}