cxx icon indicating copy to clipboard operation
cxx copied to clipboard

Bridge function parameter named `this` gives C++ compiler error

Open Enyium opened this issue 2 years ago • 0 comments

Because the std library set the precedence of calling a parameter this instead of self when necessary, I do the same. (For examples, search for (this on the Rc docs page.) Only that this, when used in a CXX bridge as a function parameter, leads to C++ compiler syntax errors () misses before this etc. in bridge_filename.rs.cc).

Of course, this can be expected to happen with other C++ keywords also. So, maybe there needs to be some sanitization and either early, friendlier bridge errors or automatic renaming (adding underscores?).

Enyium avatar Jan 25 '23 00:01 Enyium