• Kenton Varda's avatar
    Add kj::arr() for specifying arrays easily. Requries C++17. · 6643b805
    Kenton Varda authored
    std::initializer_list is problematic because it insists that its elements be const, meaning among other things that you can't move from them. So, an std::initializer_list<kj::String> is often useless. With kj::arr you can do like:
    
        kj::Array<String> = kj::arr(kj::mv(string1), kj::mv(string2));
    
    This requires C++17 due to the fold expression. This could maybe be worked around using some ugly recursion but I'm writing C++17 these days so meh.
    6643b805
Name
Last commit
Last update
c++ Loading commit data...
doc Loading commit data...
highlighting Loading commit data...
security-advisories Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
RELEASE-PROCESS.md Loading commit data...
appveyor.yml Loading commit data...
mega-test-kenton-home.cfg Loading commit data...
mega-test-kenton-work.cfg Loading commit data...
mega-test-quick.cfg Loading commit data...
mega-test.py Loading commit data...
release.sh Loading commit data...
style-guide.md Loading commit data...
super-test.sh Loading commit data...