These are chat archives for ChaiScript/ChaiScript

6th
Apr 2018
Germán Méndez Bravo
@Kronuz
Apr 06 2018 15:50
I'm having an issue using chaiscript since I started using string_view... I have a custom object which has operator[] receiving a string_view, and I configured a chaiscript class for that object in which I also added the operator "[]" to t_funcs
the issue is I'm getting an error when I run my script, saying it "Can not find appropriate array lookup operator '[]'. With parameters: (MyObject, const string)"
ans sure there isn't, as I declared (MyObject, string_view), but not the other one... now, in MyObject I can't declare both const std::string& and std::string_view, as it would result in ambiguities
how should I go about fixing this?
Germán Méndez Bravo
@Kronuz
Apr 06 2018 16:15
got it! I just added a conversion from string to string_view
(sounds so obvious) :P