# Initializing constant structs containing pointers to mutable structs

**URL:** <https://ziggit.dev/t/initializing-constant-structs-containing-pointers-to-mutable-structs/5391>\
**Category:** Help\
**Tags:** comptime\
**Created:** [July 27, 2024, 11:02pm UTC](https://ziggit.dev/t/initializing-constant-structs-containing-pointers-to-mutable-structs/5391 "2024-07-27T23:02:54Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![biosbob](https://ziggit.dev/user_avatar/ziggit.dev/biosbob/32/1987_2.png) [@biosbob](https://ziggit.dev/u/biosbob)\
**Post date:** [July 28, 2024, 2:26am UTC](https://ziggit.dev/t/initializing-constant-structs-containing-pointers-to-mutable-structs/5391/10 "2024-07-28T02:26:47Z")

</div>

interesting, indeed… but then this segues into another possibility – **code generation** via a separate upstream pass…

this harkens back to my [Elevating meta-programming into upstream meta-programs](https://ziggit.dev/t/elevating-meta-programming-into-upstream-meta-programs/4419) post, where i found it easier to have meta-programs generate source code rather than use comptime meta-programming within a single pass…

generating code from a particular definition of some `Cx` is trivial; and including that code in the next downstream pass is also straightforward… @sze has been pushing for this approach all along…

perhaps when entropy takes over your comptime code, it’s time to consider whether an upstream meta-program is a better path… i already have two phases enroute to an optimized target program; perhaps a third (initial) pass will actually simplify my life further…

---

_[View the full topic](https://ziggit.dev/t/initializing-constant-structs-containing-pointers-to-mutable-structs/5391)._
