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
/// from e-maxx.ru | |
typedef struct node | |
{ | |
int val,prior,size; | |
struct node *l,*r; | |
} node; | |
typedef node* pnode; |
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
/// from e-maxx.ru | |
typedef struct node{ | |
int prior,size; | |
int val;//value stored in the array | |
int sum;//whatever info you want to maintain in segtree for each node | |
int lazy;//whatever lazy update you want to do | |
struct node *l,*r; | |
}node; | |
typedef node* pnode; |
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
class X { | |
X(Sometype); // "ordinary constructor" | |
X(); // default constructor | |
X(const X&); // copy constructor | |
X(X&&); // move constructor | |
X& operator=(const X&); // copy assignment: clean up target and copy | |
X& operator=(X&&); // move assignment: clean up target and move | |
~X(); // destructor: clean up | |
// ... | |
}; |
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
#include <iostream> | |
#include <vector> | |
#include <ctime> | |
#include <sstream> | |
#include <iomanip> | |
int main() | |
{ |
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
size_t columns_count; | |
std::vector<size_t> columns; | |
boost::push_back(columns, boost::irange<size_t>(0, columns_count)); |
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
#ifndef _SPINLOCK_H_20170410_ | |
#define _SPINLOCK_H_20170410_ | |
#include <atomic> | |
class spinlock { | |
public: | |
spinlock() { m_lock.clear(); } | |
spinlock(const spinlock&) = delete; | |
~spinlock() = default; |