Skip to content

video(cpp11/00): manim animation for auto/decltype#53

Open
Sunrisepeak wants to merge 1 commit into
mainfrom
video/cpp11-00-auto-and-decltype
Open

video(cpp11/00): manim animation for auto/decltype#53
Sunrisepeak wants to merge 1 commit into
mainfrom
video/cpp11-00-auto-and-decltype

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

Overview

Adds the Manim animation for chapter 00 (book/src/cpp11/00-auto-and-decltype.md), following the existing videos/cpp11/* framework.

Implementation

  • MovingCameraScene + the shared videos/d2x framework (mcpp_video_start/end, DHighlight, create_code_helper) — same conventions as 09/10/11.
  • Six scenes tracking the chapter:
    1. 声明定义 — auto deduces from initializer / decltype takes the declared type
    2. 表达式类型推导 — precision preserved
    3. 复杂类型推导 — auto tames the verbose iterator type (STL real-world angle)
    4. 函数返回值推导 — trailing return auto … -> decltype(a + b)
    5. const / 引用剥离 — auto strips top-level const/ref; const auto& / decltype preserve
    6. decltype 括号陷阱 — decltype(a) vs decltype((a))

Run (uv)

uv run --with "manim==0.18.1" manim -pql videos/cpp11/00-auto-and-decltype.py

Notes

  • Syntax validated; uses only Manim/d2x APIs already proven by the existing rendering videos.
  • A full headless render could not be completed in the sandbox: the system cairo (1.18) is built with XCB support, so pycairo must compile its XCB binding, but the full libxcb*-dev headers (xcb/render.h, xcb/shm.h) aren't present and sudo apt isn't available. On a normal dev box with manim installed this renders like the other chapters.

Manim Community v0.18.1 scene mirroring the existing videos/cpp11/*
framework (MovingCameraScene + d2x mcpp_video_start/end, DHighlight,
create_code_helper). Six scenes following the chapter:
declaration, expression deduction, complex types (iterator),
trailing-return + decltype, const/reference stripping, and the
decltype parentheses pitfall.

Run: uv run --with "manim==0.18.1" manim -pql videos/cpp11/00-auto-and-decltype.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant