lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Apr 6, 2023 at 11:39 PM bil til <> wrote:

... such things make life harder for any "intellisense" editors like
VS Studio - I agree... . Those allow flexible parameters only at the
end of the parameter list, as it would also be common in compiled
languages like C++... .

In C++ you could just use two versions of insert to get the same behavior as Lua:

void insert(std::vector<value_t>&, value_t const&);
void insert(std::vector<value_t>&, std::size_t, value_t const&);

The flexibility exists outside of interpreters too, and VS Studio should be able to handle multiple signatures in C++ (Visual Studio can).