- 博客(6)
- 资源 (2)
- 问答 (2)
- 收藏
- 关注
原创 C++11 新特性 forward 完美转发 释疑
在《深入应用C++11 代码优化及工程级应用》的forward有这么个例子: #include #include using namespace std; template void PrintT(T& t) { cout << "lvalue" << endl; } template void PrintT(T&& t) { cout << "rvalue" << endl; }
2018-01-31 17:05:21 2946 2
原创 leetcode 题目 Longest Substring Without Repeating Characters
题目描述: Given a string, find the length of the longest substring without repeating characters. Examples: Given "abcabcbb", the answer is "abc", which the length is 3. Given "bbbbb", the
2018-01-29 15:13:29 169
原创 leetcode 题目 Add Two Numbers
题目描述: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers
2018-01-26 17:27:43 140
原创 boost工具 operators系列操作、基类链技术使用
boost中operators库提供了一系列的操作符重载自动生成工具类,只需要提供少量操作即可自动重载其他操作符。我们先来看两段源码:template <class T, class U, class B = ::boost::detail::empty_base<T> > struct less_than_comparable2 : B { friend bool operator<=(
2018-01-23 15:23:22 558
原创 boost的单件工具类
源码见文章底部。 class singleton 声明了一个静态引用 static T & m_instance; 这个静态引用是用来干嘛的呢?注意到该文件末尾有如下代码: template T & singleton::m_instance = singleton::get_instance();读到这里应该大概能理解了,该引用只是为了使用static的特性,该全局对象在程
2018-01-22 13:26:13 596
原创 基于OnPaint的Slider进度条自绘实现
原理: 控件绘制总会调用onpaint函数。 slider控件分为四个区域、背景区、通道背景区、左边通道进度区、滑块区四个区域。 通过Slider控件的成员函数 GetClientRect可以轻易获取控件背景区域大小。 通过Slider控件的成员函数 GetChannelRect可以轻易获取通道背景区域大小。 通过Slider控件的成员函数 GetThumbRect可以轻易获取滑块区
2017-07-24 13:31:20 1252 1
ocilib-4.3.2
2017-03-30
关于lambda表达式的返回类型的问题
2017-03-16
关于结构化异常捕获的问题
2016-07-29
TA创建的收藏夹 TA关注的收藏夹
TA关注的人