Skip to content

[SUGGESTION] Compiletime / runtime separation or constexpr, consteval, template<> sickness. #374

@fro0m

Description

@fro0m

Just to share my idea of constexpr.
C++ has a strict separation between runtime and compiletime. All about compiletime was assisted with <> characters syntax before constexpr.
And I have no idea why constexpr was introduced. It was easier to embrace <expression> with <> to specify that it is strict compile time.
<i>: int defines compile time variable,
i.e. translates to constexpr int i

if <args.cout> == 3 {
        p = a&;
    }

Forces <expression> to be compile-time, i.e. translates to

if constexpr (args.cout == 3) {
       p = a&;
   }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions