C2 forum

General Category => Implementation Details => Topic started by: lerno on December 01, 2018, 05:34:50 PM

Title: CTC (partial, full, none)
Post by: lerno on December 01, 2018, 05:34:50 PM
I'd like some clarification on how this one works and what the expectation is for each state.
Title: Re: CTC (partial, full, none)
Post by: bas on December 02, 2018, 11:56:34 AM
CTC = Compile Time Constant.
Code: [Select]
const i32 a = 32; // CTC full
const i32 b = a; // CTC full

// expr's:
i32 c = 10; // NOTE: c not const
3 + a; // CTC full
c; // CTC none
3 + c; // CTC partial (some sub-expr is FULL)

CTC full expressions are checked for value by the analyser (no casts needed then)

Also CTC full expressions can be evaluated at compile time and just added to the code as that value.
Title: Re: CTC (partial, full, none)
Post by: lerno on February 12, 2019, 12:47:59 AM
Of what use is CTC partial? I don't really see it.