Giter VIP home page Giter VIP logo

Comments (7)

p3x-robot avatar p3x-robot commented on July 24, 2024
// Create random genes for mutation
utf8_string mutatedGenes()
{
    int len = genesList.size();
    int r = randomNum(0, len-1);
    //cout << "random char:" << genesList[r] << endl;
    return genesList[r];
}
/home/patrikx3/Projects/sygnus/thermo-range-workspace/thermo-range-server/src/native/test/test-utf8.cpp: In function ‘utf8_string mutatedGenes()’:
/home/patrikx3/Projects/sygnus/thermo-range-workspace/thermo-range-server/src/native/test/test-utf8.cpp:23:23: error: could not convert ‘genesList.utf8_string::operator[](((utf8_string::size_type)r))’ from ‘utf8_string::utf8_codepoint_reference<false>’ to ‘utf8_string’
     return genesList[r];

from tiny-utf8.

DuffsDevice avatar DuffsDevice commented on July 24, 2024

Hi!

There is an operator+ for utf8_strings, so you should be able to concatenate them.
And in principle, std::string has no constructor from char, that's why utf8_string doesn't have it either.
What you can do is use the explicit constructor utf8_string( 1 , genesList[r] ).

Does that work for you?

Best regards,
Jakob

from tiny-utf8.

p3x-robot avatar p3x-robot commented on July 24, 2024

checking out, thanks you very much!

from tiny-utf8.

DuffsDevice avatar DuffsDevice commented on July 24, 2024

You're very welcome! Thanks for pointing me to this issue though, I just realized, that I had indeed added a non-explicit constructor with just char32_t, which I now made explicit. You can omit the '1'-parameter if you'd like, but please keep in mind, that this is tiny-utf8 specific :D

from tiny-utf8.

DuffsDevice avatar DuffsDevice commented on July 24, 2024

How did it go?

from tiny-utf8.

p3x-robot avatar p3x-robot commented on July 24, 2024

awesome! thanks!

from tiny-utf8.

DuffsDevice avatar DuffsDevice commented on July 24, 2024

Good to hear that, I'm glad!

from tiny-utf8.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.