#include <iostream>template <class Function, typename...Args>inline auto FunctionWrapper(Function &&fun, Args &&...args) -> decltype(fun(std::forward<Args>(args...
#include <iostream>#include <string.h>#include <string>#include <benchmark/benchmark.h>std::string mystr;void init_mystr() { mystr = "hello world.";}void test0() {...
#include <iostream>#include <tuple>template <typename T, typename Tuple>struct TupleIndex;template <typename T, typename ...Types>struct TupleIndex <T, std::tuple <...
一 可构造性判断std::is_invocabletemplate <class T, class... Args> struct is_constructible;T是待检
#include <string.h>#include <iostream>#include <cctype>bool CheckIdentification(const char *identification) { static const ushort s_weight[17] = {7, 9, 10, 5, 8, 4, 2, 1, 6, ...
https://leetcode-cn.com/problems/rotate-i
#include <time.h>#include <iostream>#include <vector>#include <thread>#include <mutex>#include <functional>#include <algorithm>#include <deque>...
#include <iostream>unsigned GetSequenceSum(unsigned given) { unsigned left = 1; unsigned right = 1; unsigned sum = 0; unsigned cnt = 0; for (;sum < given;sum += right++)...
#include <iostream>#include <cmath>double NumberBetween0and1(double x) { return 1.0 / (1 + std::exp(-x));}int main() { for (double x =-1000.0;x < 1000;x = x + 0.1) { ...
#include <iostream>#include <string>#include <functional>int MakeRandIntByStr(const std::string& str) { int rand_seed = std::hash<std::string>{}(str); srand(ran...
#include <iostream>#include <type_traits>template <typename T, typename ...Args>struct has_member_foo {private: template <typename U> static auto Check(int) -> ...
#include <iostream>#include <string>#include <memory>#define defer(fun,p) std::shared_ptr<void> defer_##p(p,std::bind(fun,std::placeh
#include <iostream>#include <string>#include <unordered_map>#include "boost/property_tree/ptree.hpp"#include "boost/ { STRING = 1, INT ...
#include <iostream>#include <list>#include <memory>#include <thread>#include <mutex>#include <condition_variable>#include "b
#include <iostream>#include <string>#include <vector>#include "json/value.h"#include "json/json.h"#include "json/reade
#include <iostream>#include <vector>#include <memory>#include <chrono>#include "boost/noncopyable.hpp"#includeincl...
#include <iostream>#include <string>#include <thread>#include "boost/noncopyable.hpp"class Thread : public boost::non
#include <iostream>#include "boost/noncopyable.hpp"template<class T>class SingleInstance : public boost::noncopyable {public: static inline T instanc
#include <iostream>#include "boost/asio.hpp"using namespace std;using namespace boost::asio;io_service G_IOS;int main() { ip::tcp::endpoint ep(ip::tcp::v4(), 2110); ip::tcp::acceptor ac...
#include <iostream>#include <new>using namespace std;template <class T>struct bin_tree_node { bin_tree_node() { lchild = nu
#include <stdlib.h>#include <unistd.h>#include <iostream>using namespace std;class fork_process {public: static inline f
#include <stdlib.h>#include <iostream>using namespace std;#define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x
一 需求:测试现代CPU整数乘法 VS 埃及乘法二 测试代码:#include <iostream>using namespace std;inline bool odd(int nrn n >> 1;}inline int ...
#include <stdint.h>#include <iostream>using namespace std;unsigned fun(unsigned n) { unsigned sum5 = 0; int t = 0; for (int i = 5;
#include <unistd.h>#include <time.h>#include <iostream>#include "select_timer.hpp"using namespace std;void show_current_time() {
#ifndef SRC_COMMON_EVENTS_HPP_#define SRC_COMMON_EVENTS_HPP_#include <map>using namespace std;template {public: common_events() { next_key...
#include <string.h>#include <time.h>#include <iostream>#include <string>#include <vector>#include <thread>#includ
#include <iostream>using namespace std;template <class T, class R, typename... Args>class self_delegate {public: self_delegabj_ptr_(obj...
使用元编程 stl算法库和自定义函数实现求整数序列最大值#include <stdint.h>#include <iostream>#include <vector>#mespace std;template <in...
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号