# Parsing JSON at compile time with C++26 static reflection

DevFeed: [Parsing JSON at compile time with C++26 static reflection](<https://devfeed.tech/articles/parsing-json-at-compile-time-with-c-26-static-reflection-29412.md>)

Original publisher: [Read original article](<https://lemire.me/blog/2026/06/14/parsing-json-at-compile-time-with-c26-static-reflection/>)

Author: Daniel Lemire

Published: 2026-06-14T14:59:44Z

Content type: tutorial

Language: en

Sources: [Daniel Lemire](<https://devfeed.tech/sources/daniel-lemire.md>)

Topics: [C++](<https://devfeed.tech/topics/c-plus-plus.md>), [JSON](<https://devfeed.tech/topics/json.md>), [C](<https://devfeed.tech/topics/c.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [gcc](<https://devfeed.tech/topics/gcc.md>)

Tags: [c](<https://devfeed.tech/tags/c.md>), [c-plus-plus](<https://devfeed.tech/tags/c-plus-plus.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [gcc](<https://devfeed.tech/tags/gcc.md>), [json](<https://devfeed.tech/tags/json.md>), [library](<https://devfeed.tech/tags/library.md>), [parsing](<https://devfeed.tech/tags/parsing.md>)

## AI overview

This tutorial demonstrates parsing a fixed JSON configuration file at compile time with C++26 static reflection and GCC 16. It explains embedding the file's bytes in the executable, using simdjson to synthesize a typed C++ object, and detecting malformed JSON during compilation instead of at startup.

## Source excerpt

Suppose that you have a configuration file in JSON. Something like this: { "width": 1920, "height": 1080, "fullscreen": true, "title": "My Game", "volume": 0.8 } Normally you ship this file alongside your program, open it at startup, read it, and parse it. That is a lot of work for data that never changes. What if ... Continue reading Parsing JSON at compile time with C++26 static reflection