{"id":61590,"library":"tcb-span","title":"tcb::span","description":"Implementation of C++20's std::span for older compilers","status":"active","version":"2022-06-15","language":"cpp","source_language":null,"source_url":null,"tags":["span","c++20","backport","header-only"],"install":[{"cmd":"vcpkg install tcb-span","lang":"bash","label":"vcpkg"},{"cmd":"# CMakeLists.txt\nfind_package(tcb_span CONFIG REQUIRED)\ntarget_link_libraries(main PRIVATE tcb::span)","lang":"cmake","label":"CMake"}],"dependencies":[],"imports":[{"symbol":"tcb/span.hpp","correct":"#include <tcb/span.hpp>"}],"quickstart":{"code":"#include <tcb/span.hpp>\n#include <iostream>\n#include <vector>\n\nint main() {\n    std::vector<int> vec = {1, 2, 3, 4};\n    tcb::span<int> sp(vec);\n    for (auto& v : sp) {\n        std::cout << v << ' ';\n    }\n    std::cout << std::endl;\n    return 0;\n}","lang":"cpp","description":"Use tcb::span as a C++20 std::span replacement"},"warnings":[{"fix":"Just include the header; no CMake target needed if using directly","message":"Header-only; no linking required","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'+20':6,15 'backport':16 'c':5,14 'compil':12 'header':18 'header-on':17 'implement':3 'older':11 'span':2,9,13 'std':8 'tcb':1","created_at":"2026-06-17T04:57:16.244534+00:00","updated_at":"2026-06-17T04:57:16.244534+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}}