Skip to content

About function is_consteval #105

@cxcIvan

Description

@cxcIvan
template <class Expr>
consteval bool is_consteval(Expr)
    { return requires { typename std::bool_constant<(Expr{}(), false)>; }; }

Hello author, I am learning about your project. I noticed that your function is used to determine whether Expr can be called. It uses typename to determine whether the template generated by std::bool_constant is a type for calling. So I think if this function is changed to the following, it should also meet your needs.

template <class Expr>
consteval bool is_consteval(Expr)
    { return requires { Expr{}(); }; }

What are your considerations for adopting the current method? Is it to facilitate further expansion of the code in the future?
Looking forward to your reply

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions