Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fro0m opened this issue Apr 15, 2023 · 2 comments

Comments

@fro0m
Copy link

fro0m commented Apr 15, 2023

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&;
   }
@fro0m fro0m changed the title [SUGGESTION] constexpr consteval template<> sickness and compiletime / runtime separation. [SUGGESTION] Compiletime / runtime separation or constexpr, consteval, template<> sickness. May 6, 2023
@AbhinavK00
Copy link

I don't think we need to mark all compile time things with <>,the <> was probably chosen with generics in mind, it just happened that all generic related work was done at compile time due to zero overhead principle

@jcanizales
Copy link

I'm a fan of the unified const {...} proposal of #255

Repository owner locked and limited conversation to collaborators Aug 30, 2023
@hsutter hsutter converted this issue into discussion #644 Aug 30, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants