You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on a simple precision-doubling template.
The largest integer supported by GCC and Clang are the __int128 and unsigned __int128 types.
Addition
In general, there is no way to access the carry flag necessary to implement multiple precision additions. Fortunately Clang detects that's what one is doing and generate good assembler, at least in AMD64 (x86-64):
The code below emulates "restrict", the function argument attribute that indicates the ranges of the pointers do not overlap. It explains its limitations:
structAligned {
alignas(1024) double d;
};
using u = unsigned;
constexpr u count = 1 << 10;
using ul = unsignedlong;
Imagine there is a template that tells you from an operation type a class-function "operate", and a type called "inverse" which gives you the inverse operation:
This is a description about a recent small project:
I've been researching and working on how to implement the best mechanisms for event handlers. Frequently the events are received by a dispatcher component that classifies the event and activates the correct processing function. For example, if the event is a market data message which could be a trade, a bid or an ask:
The main aim of AnyContainer is to solve the need for subtyping without the problems of subclassing, i.e., not forcing user types to inherit from base classes, allowing value semantics, and having the option of the performance of normal C++ code rather being forced to the inefficient dynamic dispatch through a virtual table.
We think the goals have been achieved: the performance and object code size are optimal as far as we know, and it is possible to have general solutions for runtime polymorphism, including infinite refinement.
Comparison to folly::Poly
First let us see a comparison to another type-erasure framework.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters