Calling on Nim <=> C++ experts.

I am trying to get [nimfastText](https://github.com/genotrance/nimfastText/) 
working on Travis as part of the [nimgen](https://github.com/genotrance/nimgen) 
[test suite](https://travis-ci.org/genotrance/nimgen) and have run into an 
[issue](https://travis-ci.org/genotrance/nimgen/jobs/450391907).

This is due to line 12 in the 
[test](https://github.com/genotrance/nimfastText/blob/master/tests/tnimfastText.nim#L12):
    
    
    ss = constructStdIStringStream(constructStdString("അമ്മ"))
    
    
    Run

These procs are defined in fasttext.nim, wrapping standard C++ constructors:
    
    
    proc constructStdString*(s: cstring): std_string {.importcpp: 
"std::string(@)", constructor, header: "<string>".}
    proc constructStdIStringStream*(s: std_string): istringstream {.importcpp: 
"std::istringstream(@)", constructor, header: "<sstream>".}
    
    
    Run

This further translates to the following C++ code:
    
    
    ss_Pl4bHlPuqUxT8XFxMDXCKQ = 
std::istringstream(std::string("\340\264\205\340\264\256\340\265\215\340\264\256"));
    
    
    Run

This works fine on gcc 5.x onwards (AppVeyor Linux - gcc 5.x and Ubuntu Bionic 
- gcc 7.3.x) but fails on Travis since it has gcc 4.8.4 and I run into:

[https://stackoverflow.com/questions/50926506/deleted-function-std-basic-stringstream-in-linux-with-g](https://stackoverflow.com/questions/50926506/deleted-function-std-basic-stringstream-in-linux-with-g)

Per the accepted answer, gcc 4.8 hadn't added the move operator so there's no 
way to get this working as is. I'm curious if there's a way to enable support 
for gcc 4.8 by changing the usage of the constructors in some way.

Thanks in advance.

Reply via email to