brevzin / cpp_proposals

My WG21 proposals
40 stars 22 forks source link

Improve text of P3157 #171

Open bernhardmgruber opened 4 months ago

bernhardmgruber commented 4 months ago

Hi! @andralex asked me to review this paper, so here are some textual suggestions and the following feedback:

bernhardmgruber commented 3 months ago

I have been thinking about get_body(info func) -> info for a while now, and the implementation seems extremely difficult. If the function is only declared, we would have no answer (fine). If the function's body is available, an implementation would either need to retain the token streams of the body for all functions in case they are requested, or reparse the function body upon request. The latter is really expensive because it requires reparsing the entire translation unit to reconstruct the necessary state. But it's solvable. But bugs me recently, are important functions. What if I want to reflect on a function made available by importing a module? No source is available, maybe some form of AST or implementation-specific intermediate representation. We likely don't want to expose that and we probably cannot turn this representation back into a token stream portably.