hsutter / cppfront

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

More elegant solution for pure2-main-args.cpp2 #949

Closed jarzec closed 8 months ago

jarzec commented 8 months ago

In #947 @bluetarpmedia proposed an improvement/fix for pure2-main-args.cpp2 that manually extracts the filename from args.argv[0]. Here I propose a solution using std::filesystem::path that I find a bit more elegant. Unfortunately, due to differences between the implementation details of std::filesystem::path between POSIX and Windows the type can be used directly in Cpp2 string interpolation only on POSIX systems. For that reason the solution is not as elegant as it could have been if it wasn't the case.

hsutter commented 8 months ago

Thanks!