Skip to content

Construction and destruction? #6

@denzor200

Description

@denzor200

I propose to do it like in a boost.lambda. Additionally adding aggregate and new_aggregated_ptr:

constructor<T>()(arg_list)                      T(arg_list)
aggregate<T>()(arg_list)                        T{arg_list}
destructor()(a)                                 a.~A(), where a is of type A
destructor()(pa)                                pa->~A(), where pa is of type A*
new_ptr<T>()(arg_list)                          new T(arg_list)
new_aggregated_ptr<T>()(arg_list)               new T{arg_list}
new_array<T>()(sz, val_list)                    new T[sz]{val_list}
delete_ptr()(p)                                 delete p
delete_array()(p)                               delete[] p

https://www.boost.org/doc/libs/1_76_0/doc/html/lambda/le_in_details.html#lambda.construction_and_destruction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions