hsutter / cppfront

A personal experimental C++ Syntax 2 -> Syntax 1 compiler
Other
5.39k stars 232 forks source link

Question: experimenting with Qt - can argc be non-const? #899

Closed tomFlowee closed 8 months ago

tomFlowee commented 8 months ago

This is a followup of sorts to bug #592, but now for a differnent issue that likely is a regression for the exact same usecase as that bug.

The simple code of:

main: (args) -> int = {
  app: QCoreApplication = (args.argc, args.argv);

today fails due to the QCoreApplication having the constructor: QCoreApplication::QCoreApplication(int &argc, char **argv)

notice the ampersant there.

I would argue the same as the person that reported bug 592 that the argc and argv are there for backwards compatibility and it would be nice if they follow the (granted ugly) unsafe behavior we inherited from the time when we were still walking in bearskins.

Which is to say, would you consider removing the const on args.argc in order to make this library class's constructor work.

hsutter commented 8 months ago

it would be nice if they follow the (granted ugly) unsafe behavior we inherited from the time when we were still walking in bearskins

😆 How can I say no to that picturesque description, when we've been reading Auel lately? mutable it shall be...