Git Product home page Git Product logo

infra's People

Contributors

bizehao avatar djowel avatar jpcima avatar maidamai0 avatar redtide avatar refi64 avatar thirtythreeforty avatar xeverous avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

infra's Issues

utf8_utils.hpp -> codepoint_to_utf8 bug

inline std::string codepoint_to_utf8(char32_t codepoint)
{
   std::string result{ 8 };
   detail::codepoint_to_utf8(codepoint, &result[0]);
    return result;
}

In win10 vs2022 is 4 bytes, Therefore, when inputting Chinese characters, it will lead to subsequent processing errors.

Here are my modifications:

inline std::string codepoint_to_utf8(char32_t codepoint)
{
    char cache[8];
    auto result = detail::codepoint_to_utf8(codepoint, cache);
   return result;
}

namespace redefinition problem

#if defined(INFRA_USE_STD_FS)
# include <filesystem>
namespace fs = std::filesystem;
#else
# include <ghc/filesystem.hpp>
namespace fs = ghc::filesystem;
#endif

I expected it is going to happen at some point... My project uses fs namespace consistently for its code. Can you change this? IMO such short namespace definition is rather risky at global scope. Maybe use cycfi::fs or infra::fs?

Requires BOOST - asio.hpp

Building on a newly cloned elements (and infra) it appears that BOOST is still required:

See: \elements\lib\include\elements/view.hpp
Line: 17

My understanding was that BOOST should no longer be required.

System Overview:
Windows 10 Build w/Visual Studio 19

filesystem linking

There is a problem with GCC and Clang in certain range of versions because while they have std::filesystem implementation they require explicit linking to it because at that point the library was not merged into the core standard library implementation.

https://stackoverflow.com/questions/53807011/undefined-reference-error-with-new-filesystem-library-and-clang7
https://stackoverflow.com/questions/58545562/what-is-the-correct-way-to-link-c17-filesystem-with-cmake

There is no consensus in CMake too: https://gitlab.kitware.com/cmake/cmake/issues/17834

I have this problem on one machine and I think the cleanest thing we can do is to give explicit CMake options to add -lc++fs or -lstdc++fs flags to infra target.

to_string off-by-one bug

#if (__cplusplus > 201703L)
template <std::size_t N>
std::string to_string(char8_t const (&u8_str)[N])
{
return { u8_str, u8_str+N };
}
#endif

Character literals also include terminating null byte, so for u8"" this function would use N = 1 which is wrong. It should use N -1. There is no way to have a literal character array of length 0.

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.