This file contains hidden or 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
#include <iostream> | |
#include <functional> | |
#include <tuple> | |
#include <type_traits> | |
// Actually, a subtle bug may arise when the function is using index_constant as parameter. | |
// For this reason, a more correct implementation should define a specialized class, hidden in a namespace, | |
// and forbid the use in other places. | |
// An easier, more correct, but more verbose way would be to just define two different classes for the argument list | |
// and the bounded arguments, to avoid the confusion with the index_constant bracket operator overload. |
This file contains hidden or 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
#include <cstdio> | |
template<typename First, typename... Rest> | |
struct Tuple: public Tuple<Rest...> { | |
Tuple(First first, Rest... rest): Tuple<Rest...>(rest...), first(first) {} | |
First first; | |
}; | |
template<typename First> |
This file contains hidden or 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
/***************************************************************************** | |
* QuantCup 1: Price-Time Matching Engine | |
* | |
* Submitted by: voyager | |
* | |
* Design Overview: | |
* In this implementation, the limit order book is represented using | |
* a flat linear array (pricePoints), indexed by the numeric price value. | |
* Each entry in this array corresponds to a specific price point and holds | |
* an instance of struct pricePoint. This data structure maintains a list |
This file contains hidden or 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
#include <string> | |
#include <vector> | |
#include <thread> | |
#include <iostream> | |
#include <unistd.h> | |
using namespace std; | |
class IObserver | |
{ | |
public: |
This file contains hidden or 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
// Example program | |
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <algorithm> | |
#include <time.h> | |
// *********************************** | |
// This is for measuring CPU clocks | |
#if defined(__i386__) | |
static __inline__ unsigned long long rdtsc(void) |