{"id":60546,"library":"boost-pfr","title":"Boost.PFR","description":"Boost pfr module provides a way to access fields of a struct by index without macro or boilerplate.","status":"active","version":"1.90.0","language":"cpp","source_language":null,"source_url":null,"tags":["reflection","struct","boost","header-only"],"install":[{"cmd":"vcpkg install boost-pfr","lang":"bash","label":"vcpkg"},{"cmd":"# CMakeLists.txt\nfind_package(boost_pfr CONFIG REQUIRED)\ntarget_link_libraries(main PRIVATE Boost::pfr)","lang":"cmake","label":"CMake"}],"dependencies":[],"imports":[{"symbol":"boost/pfr.hpp","correct":"#include <boost/pfr.hpp>"}],"quickstart":{"code":"#include <boost/pfr.hpp>\n#include <iostream>\n\nstruct Person { std::string name; int age; };\n\nint main() {\n    Person p{\"Alice\", 30};\n    std::cout << boost::pfr::get<0>(p) << \" is \" << boost::pfr::get<1>(p) << \" years old.\\n\";\n    return 0;\n}","lang":"cpp","description":"Access struct fields by index using Boost.PFR"},"warnings":[{"fix":"Ensure your compiler supports C++14 or newer.","message":"Boost.PFR is header-only but requires C++14 or later.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'access':9 'boilerpl':19 'boost':2,22 'boost.pfr':1 'field':10 'header':24 'header-on':23 'index':15 'macro':17 'modul':4 'pfr':3 'provid':5 'reflect':20 'struct':13,21 'way':7 'without':16","created_at":"2026-06-16T19:35:20.230007+00:00","updated_at":"2026-06-16T19:35:20.230007+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}}