- 博客(12)
- 资源 (14)
- 收藏
- 关注
原创 元编程应用-判读容器类型
#include <iostream> #include <string> #include <vector> #include <map> #include <unordered_map> #include <list> #include <queue> #include <deque> #incl...
2019-09-16 21:04:14 234
原创 google benchmark应用
#include <string.h> #include <iostream> #include <set> #include <string> #include <benchmark/benchmark.h> #define SAFE_DEL(ptr) { if (ptr) delete ptr; ptr = nullptr; } t...
2019-09-07 15:15:31 519
原创 线程安全ring buffer
#include <iostream> #include <string> #include <vector> #include <atomic> struct SpinLock { SpinLock(std::atomic_flag &flag) : flag_(flag) { while (true == fla...
2019-09-04 11:20:48 599
原创 huffman树
#include <iostream> #include <vector> struct huffman_element { huffman_element() { weight = 0; lchild = -1; rchild = -1; parent = -1; } double ...
2019-09-27 20:15:01 90
原创 元编程应用-简单AOP
#include <iostream> #include <type_traits> #define HAS_MEMBER(member)\ template<typename T, typename... Args> \ struct has_member_##member { \ private:\ template<typename U&g...
2019-09-24 16:35:21 122
原创 元编程应用-判读一个类是不是含有foo方法
#include <iostream> #include <type_traits> template <typename T, typename ...Args> struct has_member_foo { private: template <typename U> static auto Check(int) -> ...
2019-09-24 14:57:06 141
原创 memory buffer
#include <iostream> #include <vector> #include <algorithm> class MemoryBuffer { public: explicit MemoryBuffer(size_t len) : buffer_(len, 0) { } virtual ~MemoryBuffer() =...
2019-09-19 11:30:07 815
原创 测试reference_wrapper
#include <iostream> #include <functional> void add(int a, int b, int &r) { r = a + b; } int main() { int r = 0; auto f = std::bind(add, std::placeholders::_1, 20, std::ref...
2019-09-17 14:07:14 238
原创 __VA_ARGS__使用
#include <stdio.h> #include <iostream> #define LOG_TYPE0(format, ...) do { \ printf(format, __VA_ARGS__); \ } while (0) \ #define LOG_TYPE1(format, args......
2019-09-17 13:39:50 1516
原创 随机获取元素的hash map
#include <time.h> #include <iostream> #include <vector> #include <unordered_map> #include <random> std::default_random_engine G_SEED(time(NULL)); class RandomHashSet {...
2019-09-16 16:32:26 545
原创 函数包装器
#include <iostream> template <class Function, typename...Args> inline auto FunctionWrapper(Function &&fun, Args &&...args) -> decltype(fun(std::forward<Args>(args...
2019-09-09 13:38:06 127
原创 google benchmark
#include <iostream> #include <string.h> #include <string> #include <benchmark/benchmark.h> std::string mystr; void init_mystr() { mystr = "hello world."; } void test0() { ...
2019-09-07 10:20:16 259
多边形游戏
2012-01-22
字符串匹配程序
2012-01-21
计算机集群
2012-01-19
大规模并行处理机系统 MPP
2012-01-18
对称多处理机
2012-01-18
Interconnection Network
2012-01-18
Communication in Multiprocessor Systems
2012-01-18
高级计算机测试
2012-01-18
高级体系结构课程纲要
2012-01-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人