Giter Site home page Giter Site logo

kfrlib / cometa Goto Github PK

View Code? Open in Web Editor NEW
58.0 58.0 4.0 46 KB

Lightweight, header-only C++14 metaprogramming library. Pattern matching, compile-time stuffs and algorithms (arrays, type information (CTTI), string manipulation), 'value-or-errorcode' union-like type, type for passing named arguments, useful constexpr functions and many more. (MIT license)

Home Page: https://www.kfrlib.com/

License: MIT License

CMake 0.60% Python 0.92% C 11.22% C++ 87.25%
cpp14 header-only meta metaprogramming mit-license

cometa's People

Contributors

dancazarin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cometa's Issues

Cometa bug, sending VCPkgSrv to the moon (and back)

The following describes the problem as reported to MS and their answer.

I want to follow-up on the feedback you have submitted, as you described:
"The Package Server seems to go into an infinite loop on inclusion of the cometa.hpp of this library: https://github.com/kfrlib/cometa. The library is pretty good, particularly the cometa::function, which reduces the footprint of std::function<> from 64 bytes to (cometa::function<>) 8 bytes (on _WIN64), and does the same. Seems like a candidate to include in the MS-STL. Please forward to Steven T.L.!"

I have investigated the issue with VCPkgSrv you have described when using the library. It turns out the library is making wrong assumptions on the compiler implementation defined behavior, resulting in extremely deep template instantiation chain. Factually, the compiler is not in an infinite loop, but rather performing the work that it has been requested to do (that is, until it runs out of other resources like memory).

Going into specifics, IntelliSense compiler is using a different implementation (EDG) than the batch compiler in Visual Studio. They return different values for the FUNCSIG macro. CoMeta library contains function “ctype_name” intending to perform a compile-time substring operation on the result of that macro. The implementation is subtracting a length of the “known” hard-coded prefix of the FUNCSIG result without checking for unsigned integer overflow. In case of IntelliSense compiler the hard-coded prefix is longer than the actual prefix, resulting in integer wrap-around and a very large value passed subsequently to “csizeseq” instantiation, which in turn is performing recursive instantiations based on that value.

The problem should be corrected in the library source code.

Best regards,
Łukasz Mendakiewicz

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.