diff --git a/public/og/enumerator-carries-its-sql-name.png b/public/og/enumerator-carries-its-sql-name.png new file mode 100644 index 00000000..d6a230e4 Binary files /dev/null and b/public/og/enumerator-carries-its-sql-name.png differ diff --git a/social/facebook/enumerator-carries-its-sql-name/README.md b/social/facebook/enumerator-carries-its-sql-name/README.md new file mode 100644 index 00000000..85dc2af2 --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/README.md @@ -0,0 +1,130 @@ +# LinkedIn Square Post (1200x1200) + +Standard LinkedIn feed post at 1:1 square aspect ratio. Works well as a scroll-stopping image in the LinkedIn feed. + +## Usage + +```bash +brand-gen init social/linkedin-post my-post +cd my-post +# edit content.md +brand-gen build # -> index.html +brand-gen image # -> my-post.png (2400x2400 at 2x DPR) +``` + +## Directives + +All templates use one of four post types. Each uses the same directive pattern: + +### Quote + +```markdown +::::post{type=quote theme=dark logo=top-left} + +:::quote{author="Filip Sajdak" role="Founder & CEO, ScudoAI"} + +Sovereign AI is not a feature you bolt on later. It is the architecture. + +::: + +:::: +``` + +### Stat + +```markdown +::::post{type=stat theme=light accent=brand} + +:::stat{value="USD 80B" label="Worldwide sovereign cloud spend" context="Europe is the fastest-growing region at 83% YoY." source="Gartner, Feb 2026"} +::: + +:::: +``` + +### Announcement + +```markdown +::::post{type=announcement theme=light} + +:::announcement{kind="launch" date="April 2026"} + +# ScudoAI joins NVIDIA Inception + +We are thrilled to join the NVIDIA Inception program to accelerate sovereign AI deployment across European regulated industries. + +::: + +:::: +``` + +### Insight + +```markdown +::::post{type=insight theme=dark} + +:::insight{citation="EU AI Act full enforcement: 2 August 2026"} + +# The AI compliance deadline most companies are missing + +Full EU AI Act enforcement for high-risk AI systems begins in 2 August 2026. Most regulated enterprises are not ready for the documentation and audit requirements. Teams running cloud AI will face the hardest transition. + +::: + +:::: +``` + +## Attributes reference + +### `::::post` attributes + +- `type` - quote | stat | announcement | insight (required) +- `theme` - dark | light (default light) +- `accent` - brand | amber | nv (optional colored gradient background) +- `logo` - top-left | top-right | bottom-left | bottom-right (default bottom-right) + +### `:::quote` attributes + +- `author` - attribution name (appears below the quote) +- `role` - attribution role/title (appears under the author) + +### `:::stat` attributes + +- `value` - the big number (e.g. "USD 80B", "3/4", "Hours to minutes") +- `label` - short label under the value +- `context` - 1-2 sentences providing context +- `source` - small citation + +### `:::announcement` attributes + +- `kind` - launch | milestone | event | hire | partnership +- `date` - free-form date string + +### `:::insight` attributes + +- `citation` - small footer citation (e.g. regulation reference) + +## Character limits + +- **Quote body**: ~120 characters for maximum readability at thumbnail size +- **Stat label**: ~40 characters +- **Stat context**: ~200 characters +- **Announcement headline**: ~80 characters +- **Announcement body**: ~250 characters +- **Insight hook**: ~100 characters +- **Insight body**: ~300 characters + +Posts that exceed these limits will still render but typography may shrink or content may clip. + +## Media + +Add a `media/` directory to the project and reference local files: + +```markdown +:::background{image="nvidia-thor.jpg" overlay="dark"} +::: + +:::image{src="product-screenshot.png" alt="ScudoAI compliance dashboard" position="top"} +::: +``` + +Paths are relative to the project's `media/` directory. diff --git a/social/facebook/enumerator-carries-its-sql-name/assets/brand-kit.json b/social/facebook/enumerator-carries-its-sql-name/assets/brand-kit.json new file mode 100644 index 00000000..b53d139d --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/assets/brand-kit.json @@ -0,0 +1,11 @@ +{ + "template": "social/linkedin-post", + "bundleSource": "scudoai-social.css", + "brandKitVersion": "0.1.0", + "vendoredAt": "2026-11-17T20:45:37.558Z", + "files": [ + "scudoai.css", + "layout.css", + "logo-symbol.svg" + ] +} diff --git a/social/facebook/enumerator-carries-its-sql-name/assets/layout.css b/social/facebook/enumerator-carries-its-sql-name/assets/layout.css new file mode 100644 index 00000000..e69de29b diff --git a/social/facebook/enumerator-carries-its-sql-name/assets/logo-symbol.svg b/social/facebook/enumerator-carries-its-sql-name/assets/logo-symbol.svg new file mode 100644 index 00000000..1fc44966 --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/assets/logo-symbol.svg @@ -0,0 +1,22 @@ + diff --git a/social/facebook/enumerator-carries-its-sql-name/assets/scudoai.css b/social/facebook/enumerator-carries-its-sql-name/assets/scudoai.css new file mode 100644 index 00000000..612b5a12 --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/assets/scudoai.css @@ -0,0 +1,343 @@ +/* ============================================================ + * wro.cpp social card -- standalone stylesheet + * + * Self-contained styling for brand-gen's `social/linkedin-post` + * output. Replaces (does NOT extend) the scudoai-social.css that + * brand-gen ships with -- the design language here is the + * wro.cpp 'Editorial Magnet' look used by src/styles/global.css, + * not the scudoai blue-indigo deck aesthetic. + * + * Source of truth for tokens: src/styles/global.css:12-30 in the + * wrocpp.github.io repo. + * + * Brand-gen markup we style: + *
+ *
(decorative, hidden) + *
(decorative, hidden) + *
+ *

...

+ *

...

+ *
...
+ *
+ *
+ * + * ScudoAI (hidden; replaced via ::after) + *
+ *
+ * + * Other card types (card-quote, card-stat, card-announcement) + * get analogous rules at the bottom. + * ============================================================ */ + +@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500;700&display=swap'); + +:root { + --paper: #FCFAF5; + --paper-2: #F3EFE6; + --paper-3: #E8E1D0; + --ink: #1B1B1D; + --ink-muted:#55555A; + --ink-faint:#8A8A90; + --rule: #D7D2C4; + --orange: #EA541E; + --orange-2: #D6481A; + --blue: #3EB5E9; + --blue-deep:#2E8FB8; + + --font-display: 'Quicksand', system-ui, -apple-system, sans-serif; + --font-body: 'Source Serif 4', Georgia, serif; + --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; +} + +html, body { + margin: 0; + padding: 0; + background: var(--paper); + color: var(--ink); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-family: var(--font-body); + font-size: 18px; + line-height: 1.6; +} + +/* Hide brand-gen decorative noise -- the wro.cpp aesthetic is calm + * and editorial, not a dark deck with glow + grid backgrounds. */ +.grid-bg, .glow { display: none !important; } + +/* ---------------- Card frame (1200x1200) ---------------- */ +.card { + position: relative; + width: 1200px; + height: 1200px; + background: var(--paper); + /* Faint warm radial wash, mirrors body { background-image } in + * src/styles/global.css:44-49 -- gives the paper texture without + * looking flat. */ + background-image: + radial-gradient(900px 700px at 80% -10%, rgba(234, 84, 30, 0.06), transparent 60%), + radial-gradient(800px 600px at -10% 110%, rgba(62, 181, 233, 0.05), transparent 60%); + overflow: hidden; + box-sizing: border-box; + padding: 130px 110px 130px 110px; + display: flex; + flex-direction: column; + /* Faint inner border gives the card a printed-page feel. */ + border-bottom: 6px solid var(--orange); +} + +/* Override: theme=dark cards still use paper. We keep the editorial + * light look across the board so the wro.cpp brand stays consistent. + * If the user really wants a dark variant later, this is the hook. */ +.card.dark { background: var(--paper) !important; color: var(--ink) !important; } +.card.dark h1, .card.dark h2, .card.dark p, +.card.dark blockquote { color: var(--ink) !important; } + +/* ---------------- INSIGHT card ---------------- */ +.card-insight { + justify-content: center; + padding-top: 200px; /* reserve space for logo watermark (top:90px + 64px + safety) */ +} +.card-insight .insight-content { + display: flex; + flex-direction: column; + gap: 60px; + max-width: 980px; +} +.card-insight h1 { + font-family: var(--font-display); + font-weight: 700; + font-size: 92pt; + line-height: 1.02; + letter-spacing: -0.025em; + color: var(--ink); + margin: 0; +} +.card-insight h1.title-long { + font-size: 72pt; + line-height: 1.06; + letter-spacing: -0.02em; + max-height: 420px; +} +.card-insight h1.title-xlong { + font-size: 56pt; + line-height: 1.10; + letter-spacing: -0.015em; + max-height: 440px; +} +/* Auto-accent: ++ in C++/C++26 turns orange, sentence-final period + * (when wrapped in ) turns blue. The skill writes + * the heading with these spans for the wro.cpp signature look. */ +.card-insight h1 .accent { color: var(--orange); } +.card-insight h1 .dot { color: var(--blue-deep); } +.card-insight p { + font-family: var(--font-body); + font-size: 30pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 0; + max-width: 920px; +} +.card-insight .insight-citation { + font-family: var(--font-mono); + font-size: 18pt; + letter-spacing: 0.04em; + color: var(--ink-faint); + margin-top: 40px; + padding-top: 30px; + border-top: 1px solid var(--rule); + text-transform: lowercase; +} +.card-insight .insight-citation::before { + content: '// '; + color: var(--orange); + font-weight: 700; +} + +/* ---------------- QUOTE card ---------------- */ +.card-quote { justify-content: center; padding: 140px 110px; } +.card-quote .quote-content { display: flex; flex-direction: column; align-items: flex-start; } +.card-quote .quote-mark { + font-family: var(--font-display); + font-weight: 700; + font-size: 200pt; + line-height: 0.8; + color: var(--orange); + opacity: 0.20; + /* In-flow above the text (not floated in the corner) with a negative + * bottom margin so the mark nearly touches the first quote line. */ + margin: 0 0 -0.62em; +} +.card-quote .quote-body { + font-family: var(--font-display); + font-weight: 600; + font-size: 64pt; + line-height: 1.15; + letter-spacing: -0.02em; + color: var(--ink); + max-width: 980px; + margin: 0; +} +.card-quote .quote-attribution { + margin-top: 50px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-muted); +} +.card-quote .quote-attribution::before { content: '-- '; color: var(--orange); } +/* author and role are adjacent spans with no separator in the markup; + * add one so they do not run together ("wro.cppC++26 ..."). */ +.card-quote .quote-attribution .role::before { content: ' / '; color: var(--ink-faint); } + +/* ---------------- STAT card ---------------- */ +.card-stat { justify-content: center; } +/* Value and label sit side by side (label wraps to stacked lines whose + * combined height roughly matches the value); context + source span the + * full width underneath. */ +.card-stat .stat-content { + display: grid; + grid-template-columns: auto 1fr; + grid-template-areas: + "value label" + "context context" + "source source"; + column-gap: 64px; + align-items: center; +} +.card-stat .stat-value { + grid-area: value; + font-family: var(--font-display); + font-weight: 700; + font-size: 240pt; + line-height: 0.82; + letter-spacing: -0.04em; + color: var(--orange); + margin: 0; +} +.card-stat .stat-label { + grid-area: label; + font-family: var(--font-display); + font-weight: 700; + font-size: 90pt; + line-height: 1.0; + letter-spacing: -0.02em; + color: var(--ink); + /* min-content forces a per-word wrap, so "codegen steps" stacks into + * two lines next to the value instead of running on one long line. */ + width: min-content; + margin: 0; +} +.card-stat .stat-context { + grid-area: context; + font-family: var(--font-body); + font-size: 26pt; + line-height: 1.45; + color: var(--ink-muted); + margin: 56px 0 0; + max-width: 880px; +} +.card-stat .stat-source { + grid-area: source; + margin-top: 44px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-faint); +} +.card-stat .stat-source::before { content: '// '; color: var(--orange); } + +/* ---------------- ANNOUNCEMENT card ---------------- */ +.card-announcement { justify-content: center; } +.card-announcement .announcement-meta { + font-family: var(--font-mono); + font-size: 20pt; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--orange); + margin-bottom: 30px; +} +.card-announcement .announcement-content h1, +.card-announcement .announcement-content h2 { + font-family: var(--font-display); + font-weight: 700; + font-size: 78pt; + line-height: 1.05; + letter-spacing: -0.02em; + color: var(--ink); + margin: 0; +} +.card-announcement .announcement-content p { + font-family: var(--font-body); + font-size: 28pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 40px 0 0; + max-width: 900px; +} + +/* ---------------- LOGO WATERMARK ---------------- */ +/* brand-gen hard-codes "ScudoAI" in .logo-wordmark; we hide it and + * draw "wro.cpp" via ::after on the watermark. The orange ".cpp" mirrors + * the brand-mark in the site header. */ +.logo-watermark { + position: absolute; + display: flex; + align-items: center; + gap: 18px; + height: 64px; + z-index: 10; + color: var(--ink); +} +.logo-watermark.top-left { top: 90px; left: 110px; } +.logo-watermark.top-right { top: 90px; right: 110px; } +.logo-watermark.bottom-left { bottom: 60px; left: 110px; } +.logo-watermark.bottom-right { bottom: 60px; right: 110px; } +.logo-watermark svg { + width: 64px; + height: 64px; + flex-shrink: 0; + /* Magnet logo PNG already has transparent paper-tone background; + * no rounded box needed -- it sits on the paper card directly. */ +} +.logo-wordmark { + font-size: 0 !important; + line-height: 0 !important; + /* Hide the upstream "ScudoAI" text node entirely. */ +} +.logo-watermark::after { + content: 'wro.cpp'; + font-family: var(--font-display); + font-weight: 700; + font-size: 28pt; + letter-spacing: -0.025em; + color: var(--ink); + line-height: 1; + /* The .cpp portion is given orange via a ::first-line trick below + * isn't reliable for inline -- so the SKILL writes the wordmark + * with explicit spans when it owns the markup. For this default + * rendering, the whole wordmark is ink and the orange comes through + * the bottom border + eyebrow. */ +} +.logo-watermark.top-right::after, +.logo-watermark.bottom-right::after { order: -1; margin-right: 18px; } + +/* ---------------- AI DISCLOSURE BADGE ---------------- */ +/* A small, honest "AI-GENERATED" label so the disclosure rides with the + * card image on social. Bottom-right corner (logo is top-left, citation is + * center-bottom, so this corner is free). Injected into index.html by + * inject.sh. See the /ai policy page. */ +.ai-badge { + position: absolute; + bottom: 74px; /* clears the 6px orange accent bar; sits in the bottom padding band */ + right: 110px; /* matches the card side padding / logo inset */ + z-index: 10; + font-family: var(--font-mono); + font-size: 14pt; + font-weight: 500; + letter-spacing: 0.10em; + text-transform: uppercase; + color: var(--ink-faint); +} + +/* ---------------- Defensive overrides ---------------- */ +/* Anything brand-gen might have set inline using its tokens. */ +* { box-sizing: border-box; } diff --git a/social/facebook/enumerator-carries-its-sql-name/caption.md b/social/facebook/enumerator-carries-its-sql-name/caption.md new file mode 100644 index 00000000..c81f641c --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/caption.md @@ -0,0 +1,16 @@ +# The enumerator can carry its SQL name, and the build says which one is missing + +## Body +Leonardo Rossi wrote a LinkedIn post on values as template parameters. I reran its getter on GCC 16.2, Clang 22.1 and MSVC, and the template version is one movsd and a ret. Their if constexpr chain from enum to SQL name works in C++17 and its static_assert catches a new enumerator. With C++26 annotations the name moves onto the enumerator, and a static_assert with a message names the one that has none. That part builds on GCC 16.2 only. + +https://wrocpp.github.io/posts/enumerator-carries-its-sql-name/ + +## Hashtags +#cpp #cpp26 #reflection #wrocpp + +## Alt-text +wro.cpp card with the magnet logo. Headline reads "A new enumerator breaks the build, by name" with a subtitle about the SQL name as an annotation and a static_assert that names the missing one. Citation footer: wro.cpp, 2026-12-27. + +## Suggested post time +Sunday 2026-12-27, 08:00 UTC +Reason: the morning slot on the publication day; one post a day from 22 December. diff --git a/social/facebook/enumerator-carries-its-sql-name/config.yaml b/social/facebook/enumerator-carries-its-sql-name/config.yaml new file mode 100644 index 00000000..94f52b78 --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/config.yaml @@ -0,0 +1,12 @@ +template: social/linkedin-post + +size: + width: 1200 + height: 1200 + dpr: 2 + +project: + name: "enumerator-carries-its-sql-name" + author: "Filip Sajdak, Founder & CEO" + email: "office@scudoai.com" + date: "2026-12-27" diff --git a/social/facebook/enumerator-carries-its-sql-name/content.md b/social/facebook/enumerator-carries-its-sql-name/content.md new file mode 100644 index 00000000..a52b6518 --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/content.md @@ -0,0 +1,12 @@ +--- +template: social/linkedin-post +--- + +::::post{type=insight theme=dark logo=top-left} + +:::insight{citation="wro.cpp -- 2026-12-27"} +# A new enumerator breaks the build, by name +The SQL name moves onto the enumerator as an annotation, and a static_assert names the one that has none. Built on GCC 16.2 only. +::: + +:::: diff --git a/social/facebook/enumerator-carries-its-sql-name/image.png b/social/facebook/enumerator-carries-its-sql-name/image.png new file mode 100644 index 00000000..004fe6e5 Binary files /dev/null and b/social/facebook/enumerator-carries-its-sql-name/image.png differ diff --git a/social/facebook/enumerator-carries-its-sql-name/index.html b/social/facebook/enumerator-carries-its-sql-name/index.html new file mode 100644 index 00000000..50845cb2 --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/index.html @@ -0,0 +1,28 @@ + + + + + + enumerator-carries-its-sql-name + + + + + + + + + + +

A new enumerator breaks the build, by name

The SQL name moves onto the enumerator as an annotation, and a static_assert names the one that has none. Built on GCC 16.2 only.

wro.cpp -- 2026-12-27
ScudoAI
AI-generated
+ + \ No newline at end of file diff --git a/social/facebook/enumerator-carries-its-sql-name/media/.gitkeep b/social/facebook/enumerator-carries-its-sql-name/media/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/social/facebook/enumerator-carries-its-sql-name/media/README.md b/social/facebook/enumerator-carries-its-sql-name/media/README.md new file mode 100644 index 00000000..bb81c7fa --- /dev/null +++ b/social/facebook/enumerator-carries-its-sql-name/media/README.md @@ -0,0 +1,9 @@ +# Media directory + +Drop images here (PNG, JPG, SVG) for use in your post. + +Reference them in your content.md with: + + :::image{src="screenshot.png" alt="Alt text" position="top"} + +The renderer resolves paths relative to this media/ directory. diff --git a/social/linkedin/enumerator-carries-its-sql-name/README.md b/social/linkedin/enumerator-carries-its-sql-name/README.md new file mode 100644 index 00000000..85dc2af2 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/README.md @@ -0,0 +1,130 @@ +# LinkedIn Square Post (1200x1200) + +Standard LinkedIn feed post at 1:1 square aspect ratio. Works well as a scroll-stopping image in the LinkedIn feed. + +## Usage + +```bash +brand-gen init social/linkedin-post my-post +cd my-post +# edit content.md +brand-gen build # -> index.html +brand-gen image # -> my-post.png (2400x2400 at 2x DPR) +``` + +## Directives + +All templates use one of four post types. Each uses the same directive pattern: + +### Quote + +```markdown +::::post{type=quote theme=dark logo=top-left} + +:::quote{author="Filip Sajdak" role="Founder & CEO, ScudoAI"} + +Sovereign AI is not a feature you bolt on later. It is the architecture. + +::: + +:::: +``` + +### Stat + +```markdown +::::post{type=stat theme=light accent=brand} + +:::stat{value="USD 80B" label="Worldwide sovereign cloud spend" context="Europe is the fastest-growing region at 83% YoY." source="Gartner, Feb 2026"} +::: + +:::: +``` + +### Announcement + +```markdown +::::post{type=announcement theme=light} + +:::announcement{kind="launch" date="April 2026"} + +# ScudoAI joins NVIDIA Inception + +We are thrilled to join the NVIDIA Inception program to accelerate sovereign AI deployment across European regulated industries. + +::: + +:::: +``` + +### Insight + +```markdown +::::post{type=insight theme=dark} + +:::insight{citation="EU AI Act full enforcement: 2 August 2026"} + +# The AI compliance deadline most companies are missing + +Full EU AI Act enforcement for high-risk AI systems begins in 2 August 2026. Most regulated enterprises are not ready for the documentation and audit requirements. Teams running cloud AI will face the hardest transition. + +::: + +:::: +``` + +## Attributes reference + +### `::::post` attributes + +- `type` - quote | stat | announcement | insight (required) +- `theme` - dark | light (default light) +- `accent` - brand | amber | nv (optional colored gradient background) +- `logo` - top-left | top-right | bottom-left | bottom-right (default bottom-right) + +### `:::quote` attributes + +- `author` - attribution name (appears below the quote) +- `role` - attribution role/title (appears under the author) + +### `:::stat` attributes + +- `value` - the big number (e.g. "USD 80B", "3/4", "Hours to minutes") +- `label` - short label under the value +- `context` - 1-2 sentences providing context +- `source` - small citation + +### `:::announcement` attributes + +- `kind` - launch | milestone | event | hire | partnership +- `date` - free-form date string + +### `:::insight` attributes + +- `citation` - small footer citation (e.g. regulation reference) + +## Character limits + +- **Quote body**: ~120 characters for maximum readability at thumbnail size +- **Stat label**: ~40 characters +- **Stat context**: ~200 characters +- **Announcement headline**: ~80 characters +- **Announcement body**: ~250 characters +- **Insight hook**: ~100 characters +- **Insight body**: ~300 characters + +Posts that exceed these limits will still render but typography may shrink or content may clip. + +## Media + +Add a `media/` directory to the project and reference local files: + +```markdown +:::background{image="nvidia-thor.jpg" overlay="dark"} +::: + +:::image{src="product-screenshot.png" alt="ScudoAI compliance dashboard" position="top"} +::: +``` + +Paths are relative to the project's `media/` directory. diff --git a/social/linkedin/enumerator-carries-its-sql-name/assets/brand-kit.json b/social/linkedin/enumerator-carries-its-sql-name/assets/brand-kit.json new file mode 100644 index 00000000..7d00f232 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/assets/brand-kit.json @@ -0,0 +1,11 @@ +{ + "template": "social/linkedin-post", + "bundleSource": "scudoai-social.css", + "brandKitVersion": "0.1.0", + "vendoredAt": "2026-11-17T20:45:37.462Z", + "files": [ + "scudoai.css", + "layout.css", + "logo-symbol.svg" + ] +} diff --git a/social/linkedin/enumerator-carries-its-sql-name/assets/layout.css b/social/linkedin/enumerator-carries-its-sql-name/assets/layout.css new file mode 100644 index 00000000..e69de29b diff --git a/social/linkedin/enumerator-carries-its-sql-name/assets/logo-symbol.svg b/social/linkedin/enumerator-carries-its-sql-name/assets/logo-symbol.svg new file mode 100644 index 00000000..1fc44966 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/assets/logo-symbol.svg @@ -0,0 +1,22 @@ + diff --git a/social/linkedin/enumerator-carries-its-sql-name/assets/scudoai.css b/social/linkedin/enumerator-carries-its-sql-name/assets/scudoai.css new file mode 100644 index 00000000..612b5a12 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/assets/scudoai.css @@ -0,0 +1,343 @@ +/* ============================================================ + * wro.cpp social card -- standalone stylesheet + * + * Self-contained styling for brand-gen's `social/linkedin-post` + * output. Replaces (does NOT extend) the scudoai-social.css that + * brand-gen ships with -- the design language here is the + * wro.cpp 'Editorial Magnet' look used by src/styles/global.css, + * not the scudoai blue-indigo deck aesthetic. + * + * Source of truth for tokens: src/styles/global.css:12-30 in the + * wrocpp.github.io repo. + * + * Brand-gen markup we style: + *
+ *
(decorative, hidden) + *
(decorative, hidden) + *
+ *

...

+ *

...

+ *
...
+ *
+ *
+ * + * ScudoAI (hidden; replaced via ::after) + *
+ *
+ * + * Other card types (card-quote, card-stat, card-announcement) + * get analogous rules at the bottom. + * ============================================================ */ + +@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500;700&display=swap'); + +:root { + --paper: #FCFAF5; + --paper-2: #F3EFE6; + --paper-3: #E8E1D0; + --ink: #1B1B1D; + --ink-muted:#55555A; + --ink-faint:#8A8A90; + --rule: #D7D2C4; + --orange: #EA541E; + --orange-2: #D6481A; + --blue: #3EB5E9; + --blue-deep:#2E8FB8; + + --font-display: 'Quicksand', system-ui, -apple-system, sans-serif; + --font-body: 'Source Serif 4', Georgia, serif; + --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; +} + +html, body { + margin: 0; + padding: 0; + background: var(--paper); + color: var(--ink); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-family: var(--font-body); + font-size: 18px; + line-height: 1.6; +} + +/* Hide brand-gen decorative noise -- the wro.cpp aesthetic is calm + * and editorial, not a dark deck with glow + grid backgrounds. */ +.grid-bg, .glow { display: none !important; } + +/* ---------------- Card frame (1200x1200) ---------------- */ +.card { + position: relative; + width: 1200px; + height: 1200px; + background: var(--paper); + /* Faint warm radial wash, mirrors body { background-image } in + * src/styles/global.css:44-49 -- gives the paper texture without + * looking flat. */ + background-image: + radial-gradient(900px 700px at 80% -10%, rgba(234, 84, 30, 0.06), transparent 60%), + radial-gradient(800px 600px at -10% 110%, rgba(62, 181, 233, 0.05), transparent 60%); + overflow: hidden; + box-sizing: border-box; + padding: 130px 110px 130px 110px; + display: flex; + flex-direction: column; + /* Faint inner border gives the card a printed-page feel. */ + border-bottom: 6px solid var(--orange); +} + +/* Override: theme=dark cards still use paper. We keep the editorial + * light look across the board so the wro.cpp brand stays consistent. + * If the user really wants a dark variant later, this is the hook. */ +.card.dark { background: var(--paper) !important; color: var(--ink) !important; } +.card.dark h1, .card.dark h2, .card.dark p, +.card.dark blockquote { color: var(--ink) !important; } + +/* ---------------- INSIGHT card ---------------- */ +.card-insight { + justify-content: center; + padding-top: 200px; /* reserve space for logo watermark (top:90px + 64px + safety) */ +} +.card-insight .insight-content { + display: flex; + flex-direction: column; + gap: 60px; + max-width: 980px; +} +.card-insight h1 { + font-family: var(--font-display); + font-weight: 700; + font-size: 92pt; + line-height: 1.02; + letter-spacing: -0.025em; + color: var(--ink); + margin: 0; +} +.card-insight h1.title-long { + font-size: 72pt; + line-height: 1.06; + letter-spacing: -0.02em; + max-height: 420px; +} +.card-insight h1.title-xlong { + font-size: 56pt; + line-height: 1.10; + letter-spacing: -0.015em; + max-height: 440px; +} +/* Auto-accent: ++ in C++/C++26 turns orange, sentence-final period + * (when wrapped in ) turns blue. The skill writes + * the heading with these spans for the wro.cpp signature look. */ +.card-insight h1 .accent { color: var(--orange); } +.card-insight h1 .dot { color: var(--blue-deep); } +.card-insight p { + font-family: var(--font-body); + font-size: 30pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 0; + max-width: 920px; +} +.card-insight .insight-citation { + font-family: var(--font-mono); + font-size: 18pt; + letter-spacing: 0.04em; + color: var(--ink-faint); + margin-top: 40px; + padding-top: 30px; + border-top: 1px solid var(--rule); + text-transform: lowercase; +} +.card-insight .insight-citation::before { + content: '// '; + color: var(--orange); + font-weight: 700; +} + +/* ---------------- QUOTE card ---------------- */ +.card-quote { justify-content: center; padding: 140px 110px; } +.card-quote .quote-content { display: flex; flex-direction: column; align-items: flex-start; } +.card-quote .quote-mark { + font-family: var(--font-display); + font-weight: 700; + font-size: 200pt; + line-height: 0.8; + color: var(--orange); + opacity: 0.20; + /* In-flow above the text (not floated in the corner) with a negative + * bottom margin so the mark nearly touches the first quote line. */ + margin: 0 0 -0.62em; +} +.card-quote .quote-body { + font-family: var(--font-display); + font-weight: 600; + font-size: 64pt; + line-height: 1.15; + letter-spacing: -0.02em; + color: var(--ink); + max-width: 980px; + margin: 0; +} +.card-quote .quote-attribution { + margin-top: 50px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-muted); +} +.card-quote .quote-attribution::before { content: '-- '; color: var(--orange); } +/* author and role are adjacent spans with no separator in the markup; + * add one so they do not run together ("wro.cppC++26 ..."). */ +.card-quote .quote-attribution .role::before { content: ' / '; color: var(--ink-faint); } + +/* ---------------- STAT card ---------------- */ +.card-stat { justify-content: center; } +/* Value and label sit side by side (label wraps to stacked lines whose + * combined height roughly matches the value); context + source span the + * full width underneath. */ +.card-stat .stat-content { + display: grid; + grid-template-columns: auto 1fr; + grid-template-areas: + "value label" + "context context" + "source source"; + column-gap: 64px; + align-items: center; +} +.card-stat .stat-value { + grid-area: value; + font-family: var(--font-display); + font-weight: 700; + font-size: 240pt; + line-height: 0.82; + letter-spacing: -0.04em; + color: var(--orange); + margin: 0; +} +.card-stat .stat-label { + grid-area: label; + font-family: var(--font-display); + font-weight: 700; + font-size: 90pt; + line-height: 1.0; + letter-spacing: -0.02em; + color: var(--ink); + /* min-content forces a per-word wrap, so "codegen steps" stacks into + * two lines next to the value instead of running on one long line. */ + width: min-content; + margin: 0; +} +.card-stat .stat-context { + grid-area: context; + font-family: var(--font-body); + font-size: 26pt; + line-height: 1.45; + color: var(--ink-muted); + margin: 56px 0 0; + max-width: 880px; +} +.card-stat .stat-source { + grid-area: source; + margin-top: 44px; + font-family: var(--font-mono); + font-size: 18pt; + color: var(--ink-faint); +} +.card-stat .stat-source::before { content: '// '; color: var(--orange); } + +/* ---------------- ANNOUNCEMENT card ---------------- */ +.card-announcement { justify-content: center; } +.card-announcement .announcement-meta { + font-family: var(--font-mono); + font-size: 20pt; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--orange); + margin-bottom: 30px; +} +.card-announcement .announcement-content h1, +.card-announcement .announcement-content h2 { + font-family: var(--font-display); + font-weight: 700; + font-size: 78pt; + line-height: 1.05; + letter-spacing: -0.02em; + color: var(--ink); + margin: 0; +} +.card-announcement .announcement-content p { + font-family: var(--font-body); + font-size: 28pt; + line-height: 1.5; + color: var(--ink-muted); + margin: 40px 0 0; + max-width: 900px; +} + +/* ---------------- LOGO WATERMARK ---------------- */ +/* brand-gen hard-codes "ScudoAI" in .logo-wordmark; we hide it and + * draw "wro.cpp" via ::after on the watermark. The orange ".cpp" mirrors + * the brand-mark in the site header. */ +.logo-watermark { + position: absolute; + display: flex; + align-items: center; + gap: 18px; + height: 64px; + z-index: 10; + color: var(--ink); +} +.logo-watermark.top-left { top: 90px; left: 110px; } +.logo-watermark.top-right { top: 90px; right: 110px; } +.logo-watermark.bottom-left { bottom: 60px; left: 110px; } +.logo-watermark.bottom-right { bottom: 60px; right: 110px; } +.logo-watermark svg { + width: 64px; + height: 64px; + flex-shrink: 0; + /* Magnet logo PNG already has transparent paper-tone background; + * no rounded box needed -- it sits on the paper card directly. */ +} +.logo-wordmark { + font-size: 0 !important; + line-height: 0 !important; + /* Hide the upstream "ScudoAI" text node entirely. */ +} +.logo-watermark::after { + content: 'wro.cpp'; + font-family: var(--font-display); + font-weight: 700; + font-size: 28pt; + letter-spacing: -0.025em; + color: var(--ink); + line-height: 1; + /* The .cpp portion is given orange via a ::first-line trick below + * isn't reliable for inline -- so the SKILL writes the wordmark + * with explicit spans when it owns the markup. For this default + * rendering, the whole wordmark is ink and the orange comes through + * the bottom border + eyebrow. */ +} +.logo-watermark.top-right::after, +.logo-watermark.bottom-right::after { order: -1; margin-right: 18px; } + +/* ---------------- AI DISCLOSURE BADGE ---------------- */ +/* A small, honest "AI-GENERATED" label so the disclosure rides with the + * card image on social. Bottom-right corner (logo is top-left, citation is + * center-bottom, so this corner is free). Injected into index.html by + * inject.sh. See the /ai policy page. */ +.ai-badge { + position: absolute; + bottom: 74px; /* clears the 6px orange accent bar; sits in the bottom padding band */ + right: 110px; /* matches the card side padding / logo inset */ + z-index: 10; + font-family: var(--font-mono); + font-size: 14pt; + font-weight: 500; + letter-spacing: 0.10em; + text-transform: uppercase; + color: var(--ink-faint); +} + +/* ---------------- Defensive overrides ---------------- */ +/* Anything brand-gen might have set inline using its tokens. */ +* { box-sizing: border-box; } diff --git a/social/linkedin/enumerator-carries-its-sql-name/caption.md b/social/linkedin/enumerator-carries-its-sql-name/caption.md new file mode 100644 index 00000000..4c08f8e8 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/caption.md @@ -0,0 +1,22 @@ +# The enumerator can carry its SQL name, and the build says which one is missing + +## Body +Leonardo Rossi wrote a LinkedIn post on values as template parameters. I ran two of its examples. + +Their claim about the getter holds in my run. A member function pointer as a template argument reads the member with one movsd and a ret on GCC 16.2, Clang 22.1 and MSVC. The same pointer passed at run time needs an add, a test, a branch and an indirect jump on GCC and Clang. + +Their chain of if constexpr that maps an enum to SQL column names works in C++17, and the static_assert in its last branch does stop the build for a new enumerator. The cost is a second list: every enumerator appears in the enum and again in the chain. + +With C++26 annotations the name sits on the enumerator, so the chain goes away. A static_assert with a message then names the enumerator that has no name, or repeats one, for example "Draft::Raw has no [[=sql{...}]] annotation" on GCC 16.2. The annotation version builds on GCC 16.2 only, because the Bloomberg Clang fork lacks annotations_of_with_type. + +https://wrocpp.github.io/posts/enumerator-carries-its-sql-name/ + +## Hashtags +#cpp #cpp26 #reflection #annotations #templates #enum #wrocpp + +## Alt-text +wro.cpp card with the magnet logo. Headline reads "A new enumerator breaks the build, by name" with a subtitle about the SQL name as an annotation and a static_assert that names the missing one. Citation footer: wro.cpp, 2026-12-27. + +## Suggested post time +Sunday 2026-12-27, 08:00 UTC +Reason: the morning slot on the publication day; one post a day from 22 December. diff --git a/social/linkedin/enumerator-carries-its-sql-name/config.yaml b/social/linkedin/enumerator-carries-its-sql-name/config.yaml new file mode 100644 index 00000000..94f52b78 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/config.yaml @@ -0,0 +1,12 @@ +template: social/linkedin-post + +size: + width: 1200 + height: 1200 + dpr: 2 + +project: + name: "enumerator-carries-its-sql-name" + author: "Filip Sajdak, Founder & CEO" + email: "office@scudoai.com" + date: "2026-12-27" diff --git a/social/linkedin/enumerator-carries-its-sql-name/content.md b/social/linkedin/enumerator-carries-its-sql-name/content.md new file mode 100644 index 00000000..a52b6518 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/content.md @@ -0,0 +1,12 @@ +--- +template: social/linkedin-post +--- + +::::post{type=insight theme=dark logo=top-left} + +:::insight{citation="wro.cpp -- 2026-12-27"} +# A new enumerator breaks the build, by name +The SQL name moves onto the enumerator as an annotation, and a static_assert names the one that has none. Built on GCC 16.2 only. +::: + +:::: diff --git a/social/linkedin/enumerator-carries-its-sql-name/image.png b/social/linkedin/enumerator-carries-its-sql-name/image.png new file mode 100644 index 00000000..d6a230e4 Binary files /dev/null and b/social/linkedin/enumerator-carries-its-sql-name/image.png differ diff --git a/social/linkedin/enumerator-carries-its-sql-name/index.html b/social/linkedin/enumerator-carries-its-sql-name/index.html new file mode 100644 index 00000000..50845cb2 --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/index.html @@ -0,0 +1,28 @@ + + + + + + enumerator-carries-its-sql-name + + + + + + + + + + +

A new enumerator breaks the build, by name

The SQL name moves onto the enumerator as an annotation, and a static_assert names the one that has none. Built on GCC 16.2 only.

wro.cpp -- 2026-12-27
ScudoAI
AI-generated
+ + \ No newline at end of file diff --git a/social/linkedin/enumerator-carries-its-sql-name/media/.gitkeep b/social/linkedin/enumerator-carries-its-sql-name/media/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/social/linkedin/enumerator-carries-its-sql-name/media/README.md b/social/linkedin/enumerator-carries-its-sql-name/media/README.md new file mode 100644 index 00000000..bb81c7fa --- /dev/null +++ b/social/linkedin/enumerator-carries-its-sql-name/media/README.md @@ -0,0 +1,9 @@ +# Media directory + +Drop images here (PNG, JPG, SVG) for use in your post. + +Reference them in your content.md with: + + :::image{src="screenshot.png" alt="Alt text" position="top"} + +The renderer resolves paths relative to this media/ directory. diff --git a/src/content/posts/2026-12-27-enumerator-carries-its-sql-name.mdx b/src/content/posts/2026-12-27-enumerator-carries-its-sql-name.mdx new file mode 100644 index 00000000..d052cbc4 --- /dev/null +++ b/src/content/posts/2026-12-27-enumerator-carries-its-sql-name.mdx @@ -0,0 +1,100 @@ +--- +title: "The enumerator can carry its SQL name, and the build says which one is missing" +slug: "enumerator-carries-its-sql-name" +pubDate: 2026-12-27 +author: filip-sajdak +language: en +kind: short +audience: working-cpp +tags: [cpp, cpp26, reflection, annotations, nttp, templates, enum, gcc] +summary: "Leonardo Rossi's post maps an enum to SQL column names with a chain of if constexpr and a static_assert, and reads a member through a function pointer template argument. I ran both. The getter is one movsd on GCC 16.2, Clang 22.1 and MSVC. With C++26 annotations the name moves onto the enumerator, and a static_assert with a message names the enumerator that has none. Clang's Bloomberg fork lacks the library function this needs." +draft: false +relatedPosts: [enum-to-string, enum-aliases, annotations, turn-embedded-sql-schema-into-row-types, ctre-cnttp] +--- + +import GodboltEmbed from '../../components/GodboltEmbed.astro'; +import PostLink from '../../components/PostLink.astro'; + +Leonardo Rossi wrote a LinkedIn post on values as template parameters. {/* LINK: Leonardo Rossi LinkedIn post, URL from the user */} +Two of its examples are worth running. One reads a member through a function pointer that is a template argument. The other maps an enum to SQL column names with a build error for every new enumerator. I ran both on 2026-11-17, and then moved the names onto the enumerators with C++26 annotations. + +## In short + +- Their claim about the getter holds in my run. The template version is one `movsd` plus `ret` on GCC 16.2, Clang 22.1 and MSVC. +- The same getter as a run-time member pointer needs an add, a test, a branch and an indirect jump on GCC and Clang. +- Their chain of `if constexpr` works in C++17, and the `static_assert` in its last branch does stop the build for a new enumerator. It costs one line per enumerator in the chain, besides the enum. +- With an annotation the name sits on the enumerator and the chain disappears. A `static_assert` with a message names the enumerator that lacks one, and the one that repeats a name. +- A class used as a template argument needs public members. Both compilers say so in the error. + +## The getter is one instruction + +Their example takes the member function as a template argument: + +```cpp +template +double readFrom(const Sensor& sensor) { return (sensor.*Getter)(); } +``` + +They write that the read becomes a single instruction on GCC, Clang and MSVC. I compiled two functions. `viaTemplate` calls `readFrom<&Sensor::intensity>`. `viaPointer` gets the member pointer as an argument. + +| compiler, options | `viaTemplate` | `viaPointer` | +|---|---|---| +| GCC 16.2, `-std=c++26 -O2` | `movsd xmm0, [rdi+8]`, `ret` | `add`, `test`, `je`, two loads, `jmp` | +| Clang 22.1, `-std=c++26 -O2` | `movsd xmm0, [rdi+8]`, `ret` | `add`, `test`, `je`, two loads, `jmp` | +| MSVC, `/std:c++latest /O2` | `movsd xmm0, [rcx+8]`, `ret` | `rex_jmp rdx` | + +The pointer is part of the type, so the compiler knows which member function it calls. `Sensor::intensity` is defined in the class, so its body is visible. For a getter defined in another translation unit I have no listing. + + + +## The chain, and what it guards + +Their `sqlName()` is a chain of `if constexpr (Col == Column::Name)` branches. The last branch holds `static_assert(Col == Column::Wavelength, "Map the new Column here.")`. A fourth enumerator reaches that branch and fails. + +I built the same shape in C++17 with three enumerators. It runs on GCC 16.2 and Clang 22.1 and prints `name wavelength_nm intensity`. With a fourth enumerator `Raw` and a use of `sqlName()`, both compilers stop. GCC 16.2 says `static assertion failed: Map the new Column here.` Clang 22.1 says `static assertion failed due to requirement '(Column)3 == Column::Intensity': Map the new Column here.` + +So the guard works. What it leaves is a second list. Every enumerator appears in the enum and again in the chain, and the guard fires only when someone instantiates the new one. + + + +## The name on the enumerator + +C++26 annotations let the enumerator hold its own name: + +```cpp +enum class Column { + Name [[=sql{"name"}]], + Wavelength [[=sql{"wavelength_nm"}]], + Intensity [[=sql{"intensity"}]], +}; +``` + +Here `sql` is a small structural type that holds a character array. A `string_view` is not structural. The annotations post explains why, and the enum post shows the lookup by `enumerators_of`. A `consteval` function finds the annotation with `annotations_of_with_type`. Then `of_value` is `"wavelength_nm"`. There is no chain, so a new enumerator adds one line, in the enum. + +An enumerator with no annotation is the case their `static_assert` handled. In my first version the lookup indexed an empty list. GCC 16.2 answered with `call to non-'constexpr' function 'void std::__glibcxx_assert_fail(...)'` at `stl_vector.h:1253`. That names a library header, not the enumerator. + +A check over all the enumerators reads better. `problem()` is `consteval` and returns a sentence, empty when all is well: + +```cpp +static_assert(sqlnames::problem().empty(), sqlnames::problem()); +``` + +C++26 allows a constant expression as the message. For a `Draft` enum whose last enumerator has no annotation, GCC 16.2 prints `static assertion failed: Draft::Raw has no [[=sql{...}]] annotation`. For two enumerators with the SQL name `x` it prints `static assertion failed: Twice::B repeats the SQL name 'x'`. Without the message the same assertion prints only `static assertion failed`. + +A value that is no enumerator, such as `static_cast(7)`, reaches a `throw` in the lookup. GCC 16.2 prints `uncaught exception '(const char*)"this value is not an enumerator"'`. A reflection avoids the question: `of_enumerator<^^Column::Intensity>` takes the enumerator itself, so no value can fail to match. That works because `std::meta::info` is a structural type and can be a template argument. The aliases post covers the other benefit, that two enumerators with one value keep their own names. + + + +## Structural types + +They also note that the argument must be a structural type, with all members public. I tried a class with one private member as a template parameter. GCC 16.2 says `'Pt' is not a valid type for a template non-type parameter because it is not structural`, with the note `'Pt::v_' is not public`. Clang 22.1 says `type 'Pt' of non-type template parameter is not a structural type`. + +The example wraps the test in a concept over a requires-expression, so the program compiles and prints which of two classes qualifies. Their post says Qt's `QFlags` cannot be used this way. I did not open the Qt sources, so that remark is theirs. + + + +## What I did not run + +- The annotation version builds on GCC 16.2 only. Clang's Bloomberg reflection fork (`clang_bb_p2996`, 2026-11-03 build) has no `annotations_of_with_type` and rejects the file. +- I did not build the assembly example on other targets, and timed nothing. +- The code is at [the examples repository](https://github.com/wrocpp/cpp26-reflection-examples/tree/main/posts/137-values-as-template-parameters).